+2008-10-15 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21610
+ run-webkit-threads --threaded crashes in StructureID destructor
+
+ * kjs/StructureID.cpp:
+ (JSC::StructureID::StructureID):
+ (JSC::StructureID::~StructureID):
+ Protect access to a static (debug-only) HashSet with a lock.
+
2008-10-15 Sam Weinig <sam@webkit.org>
Reviewed by Goeffrey Garen.
#include <wtf/RefCountedLeakCounter.h>
#include <wtf/RefPtr.h>
+#if ENABLE(JSC_MULTIPLE_THREADS)
+#include <wtf/Threading.h>
+#endif
+
using namespace std;
namespace JSC {
#ifndef NDEBUG
static WTF::RefCountedLeakCounter structureIDCounter("StructureID");
+#if ENABLE(JSC_MULTIPLE_THREADS)
+static Mutex ignoreSetMutex;
+#endif
+
static bool shouldIgnoreLeaks;
static HashSet<StructureID*> ignoreSet;
#endif
m_transitions.singleTransition = 0;
#ifndef NDEBUG
+#if ENABLE(JSC_MULTIPLE_THREADS)
+ MutexLocker protect(ignoreSetMutex);
+#endif
if (shouldIgnoreLeaks)
ignoreSet.add(this);
else
delete m_transitions.table;
#ifndef NDEBUG
+#if ENABLE(JSC_MULTIPLE_THREADS)
+ MutexLocker protect(ignoreSetMutex);
+#endif
HashSet<StructureID*>::iterator it = ignoreSet.find(this);
if (it != ignoreSet.end())
ignoreSet.remove(it);