Ignore:
Timestamp:
Apr 1, 2008, 11:38:32 PM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Make MathExtras.h thread safe.

  • kjs/math_object.cpp: (KJS::mathProtoFuncRandom): If threading is enabled, rely on initializeThreading to call wtf_random_init().
  • wtf/Threading.h:
  • wtf/ThreadingGtk.cpp: (WTF::initializeThreading):
  • wtf/ThreadingNone.cpp: (WTF::initializeThreading):
  • wtf/ThreadingPthreads.cpp: (WTF::initializeThreading):
  • wtf/ThreadingWin.cpp: (WTF::initializeThreading): Call wtf_random_init(); made the function non-inline to avoid having to include too many headers in Threading.h.
File:
1 edited

Legend:

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

    r30855 r31560  
    6666#include <windows.h>
    6767#include <wtf/HashMap.h>
     68#include <wtf/MathExtras.h>
    6869
    6970namespace WTF {
    7071
    7172Mutex* atomicallyInitializedStaticMutex;
     73
     74void initializeThreading()
     75{
     76    if (!atomicallyInitializedStaticMutex) {
     77        atomicallyInitializedStaticMutex = new Mutex;
     78        wtf_random_init();
     79    }
     80}
    7281
    7382static Mutex& threadMapMutex()
Note: See TracChangeset for help on using the changeset viewer.