Changeset 37990 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 29, 2008, 8:38:55 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-10-29 Steve Falkenburg <[email protected]>

<rdar://problem/6326563> Crash on launch

For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex.


Exporting data from a DLL on Windows requires specifying declspec(dllimport) in the header used by
callers, but
declspec(dllexport) when defined in the DLL implementation. By instead exporting
the explicit lock/unlock functions, we can avoid this.


Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function.


Reviewed by Darin Adler.

  • wtf/Threading.h: (WTF::lockAtomicallyInitializedStaticMutex): (WTF::unlockAtomicallyInitializedStaticMutex):
  • wtf/ThreadingWin.cpp: (WTF::lockAtomicallyInitializedStaticMutex): (WTF::unlockAtomicallyInitializedStaticMutex):

WebKit/win:

2008-10-29 Steve Falkenburg <[email protected]>

<rdar://problem/6326563> Crash on launch


For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex.


Exporting data from a DLL on Windows requires specifying declspec(dllimport) in the header used by
callers, but
declspec(dllexport) when defined in the DLL implementation. By instead exporting
the explicit lock/unlock functions, we can avoid this.


Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function.


Reviewed by Darin Adler.

  • WebKit.vcproj/WebKit.def:
  • WebKit.vcproj/WebKit_debug.def:
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37989 r37990  
     12008-10-29  Steve Falkenburg  <[email protected]>
     2
     3        <rdar://problem/6326563> Crash on launch
     4
     5        For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex.
     6       
     7        Exporting data from a DLL on Windows requires specifying __declspec(dllimport) in the header used by
     8        callers, but __declspec(dllexport) when defined in the DLL implementation. By instead exporting
     9        the explicit lock/unlock functions, we can avoid this.
     10       
     11        Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function.
     12       
     13        Reviewed by Darin Adler.
     14
     15        * wtf/Threading.h:
     16        (WTF::lockAtomicallyInitializedStaticMutex):
     17        (WTF::unlockAtomicallyInitializedStaticMutex):
     18        * wtf/ThreadingWin.cpp:
     19        (WTF::lockAtomicallyInitializedStaticMutex):
     20        (WTF::unlockAtomicallyInitializedStaticMutex):
     21
    1222008-10-29  Sam Weinig  <[email protected]>
    223
  • trunk/JavaScriptCore/wtf/Threading.h

    r37732 r37990  
    9696// For portability, we do not use thread-safe statics natively supported by some compilers (e.g. gcc).
    9797#define AtomicallyInitializedStatic(T, name) \
    98     WTF::atomicallyInitializedStaticMutex->lock(); \
     98    WTF::lockAtomicallyInitializedStaticMutex(); \
    9999    static T name; \
    100     WTF::atomicallyInitializedStaticMutex->unlock();
     100    WTF::unlockAtomicallyInitializedStaticMutex();
    101101
    102102namespace WTF {
     
    252252void initializeThreading();
    253253
     254#if !PLATFORM(WIN_OS)
    254255extern Mutex* atomicallyInitializedStaticMutex;
     256inline void lockAtomicallyInitializedStaticMutex() { atomicallyInitializedStaticMutex->lock(); }
     257inline void unlockAtomicallyInitializedStaticMutex() { atomicallyInitializedStaticMutex->unlock(); }
     258#else
     259void lockAtomicallyInitializedStaticMutex();
     260void unlockAtomicallyInitializedStaticMutex();
     261#endif
    255262
    256263} // namespace WTF
  • trunk/JavaScriptCore/wtf/ThreadingWin.cpp

    r37364 r37990  
    108108}
    109109
    110 Mutex* atomicallyInitializedStaticMutex;
     110static Mutex* atomicallyInitializedStaticMutex;
     111
     112void lockAtomicallyInitializedStaticMutex()
     113{
     114    atomicallyInitializedStaticMutex->lock();
     115}
     116
     117void unlockAtomicallyInitializedStaticMutex()
     118{
     119    atomicallyInitializedStaticMutex->unlock();
     120}
    111121
    112122static ThreadIdentifier mainThreadIdentifier;
Note: See TracChangeset for help on using the changeset viewer.