Reviewed by Darin.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2008 10:29:47 +0000 (10:29 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2008 10:29:47 +0000 (10:29 +0000)
commitb2c070bec9c8ea37790c2aa8d9d88811f4754990
tree5aaff12e5fc85be397b4f6f43a5c0b484a4dc78e
parentf07065fbc29c445073fdfd576eb2e9157da97944
    Reviewed by Darin.

        Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
        for the sake of non-WebKit clients.

JavaScriptCore:
        * API/JSBase.cpp:
        (JSGarbageCollect):
        * API/JSContextRef.cpp:
        (JSGlobalContextCreate):
        These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
        and JSClassRef functions that can be called earlier, but they do not do anything that
        requires initializeThreading.

        * kjs/InitializeThreading.cpp:
        (KJS::doInitializeThreading):
        (KJS::initializeThreading):
        On Darwin, make the initialization happen under pthread_once, since there is no guarantee
        that non-WebKit clients won't try to call this function re-entrantly.

        * kjs/InitializeThreading.h:
        * wtf/Threading.h:
        Spell out initializeThreading contract.

        * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
        Darwin, even if threading was initialized from a secondary thread.

JavaScriptGlue:
        * JavaScriptGlue.cpp:
        (JSRunCreate):
        (JSCollect):
        (JSCreateJSArrayFromCFArray):
        (JSLockInterpreter):
        These are all possible JavaScriptGlue entry points.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/API/JSBase.cpp
JavaScriptCore/API/JSContextRef.cpp
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/InitializeThreading.cpp
JavaScriptCore/kjs/InitializeThreading.h
JavaScriptCore/wtf/Threading.h
JavaScriptCore/wtf/ThreadingPthreads.cpp
JavaScriptGlue/ChangeLog
JavaScriptGlue/JavaScriptGlue.cpp