X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..14957cd040308e3eeec43d26bae5d76da13fcd85:/runtime/InitializeThreading.cpp?ds=inline diff --git a/runtime/InitializeThreading.cpp b/runtime/InitializeThreading.cpp index 2605a9a..27611b7 100644 --- a/runtime/InitializeThreading.cpp +++ b/runtime/InitializeThreading.cpp @@ -29,13 +29,14 @@ #include "config.h" #include "InitializeThreading.h" -#include "Collector.h" +#include "Heap.h" #include "dtoa.h" #include "Identifier.h" #include "JSGlobalObject.h" #include "UString.h" #include #include +#include using namespace WTF; @@ -47,12 +48,17 @@ static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT; static void initializeThreadingOnce() { + // StringImpl::empty() does not construct its static string in a threadsafe fashion, + // so ensure it has been initialized from here. + StringImpl::empty(); + WTF::initializeThreading(); - initializeUString(); + wtfThreadData(); JSGlobalData::storeVPtrs(); #if ENABLE(JSC_MULTIPLE_THREADS) s_dtoaP5Mutex = new Mutex; initializeDates(); + RegisterFile::initializeThreading(); #endif }