Ignore:
Timestamp:
Jun 16, 2008, 6:44:08 PM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Initialize functionQueueMutex in a safe manner.

  • wtf/MainThread.cpp: (WTF::functionQueueMutex): Made it an AtomicallyInitializedStatic.

(WTF::dispatchFunctionsFromMainThread):
(WTF::setMainThreadCallbacksPaused):
Assert that the current thread is main, meaning that the callbacksPaused static can be
accessed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/MainThread.cpp

    r31730 r34609  
    4747static Mutex& functionQueueMutex()
    4848{
    49     static Mutex staticFunctionQueueMutex;
     49    AtomicallyInitializedStatic(Mutex, staticFunctionQueueMutex);
    5050    return staticFunctionQueueMutex;
    5151}
     
    5959void dispatchFunctionsFromMainThread()
    6060{
     61    ASSERT(isMainThread());
     62
    6163    if (callbacksPaused)
    6264        return;
     
    8688void setMainThreadCallbacksPaused(bool paused)
    8789{
     90    ASSERT(isMainThread());
     91
    8892    if (callbacksPaused == paused)
    8993        return;
Note: See TracChangeset for help on using the changeset viewer.