Ignore:
Timestamp:
Oct 15, 2008, 11:41:08 PM (17 years ago)
Author:
[email protected]
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/StructureID.cpp

    r37629 r37630  
    3434#include <wtf/RefPtr.h>
    3535
     36#if ENABLE(JSC_MULTIPLE_THREADS)
     37#include <wtf/Threading.h>
     38#endif
     39
    3640using namespace std;
    3741
     
    4044#ifndef NDEBUG
    4145static WTF::RefCountedLeakCounter structureIDCounter("StructureID");
     46
     47#if ENABLE(JSC_MULTIPLE_THREADS)
     48static Mutex ignoreSetMutex;
     49#endif
    4250
    4351static bool shouldIgnoreLeaks;
     
    8391
    8492#ifndef NDEBUG
     93#if ENABLE(JSC_MULTIPLE_THREADS)
     94    MutexLocker protect(ignoreSetMutex);
     95#endif
    8596    if (shouldIgnoreLeaks)
    8697        ignoreSet.add(this);
     
    116127
    117128#ifndef NDEBUG
     129#if ENABLE(JSC_MULTIPLE_THREADS)
     130    MutexLocker protect(ignoreSetMutex);
     131#endif
    118132    HashSet<StructureID*>::iterator it = ignoreSet.find(this);
    119133    if (it != ignoreSet.end())
Note: See TracChangeset for help on using the changeset viewer.