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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.