Ignore:
Timestamp:
Jan 6, 2009, 11:24:18 PM (16 years ago)
Author:
[email protected]
Message:

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=23142
ThreadGlobalData leaks seen on buildbot

  • wtf/ThreadSpecific.h: (WTF::ThreadSpecific::destroy): Temporarily reset the thread specific value to make getter work on Mac OS X.
  • wtf/Platform.h: Touch this file again to make sure all Windows builds use the most recent version of ThreadSpecific.h.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/ThreadSpecific.h

    r39604 r39672  
    9898{
    9999    Data* data = static_cast<Data*>(ptr);
     100
     101    // We want get() to keep working while data destructor works, because it can be called indirectly by the destructor.
     102    // Some pthreads implementations zero out the pointer before calling destroy(), so we temporarily reset it.
     103    pthread_setspecific(data->owner->m_key, ptr);
    100104    data->value->~T();
    101105    fastFree(data->value);
    102     // Only reset the pointer after value destructor finishes - otherwise, code in destructor could trigger
    103     // re-creation of the object.
    104106    pthread_setspecific(data->owner->m_key, 0);
    105107    delete data;
Note: See TracChangeset for help on using the changeset viewer.