Changeset 37990 in webkit


Ignore:
Timestamp:
Oct 29, 2008 8:38:55 PM (15 years ago)
Author:
sfalken@apple.com
Message:

JavaScriptCore:

2008-10-29 Steve Falkenburg <sfalken@apple.com>

<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 <sfalken@apple.com>

<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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37989 r37990  
     12008-10-29  Steve Falkenburg  <sfalken@apple.com>
     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  <sam@webkit.org>
    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;
  • trunk/WebKit/win/ChangeLog

    r37978 r37990  
     12008-10-29  Steve Falkenburg  <sfalken@apple.com>
     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        * WebKit.vcproj/WebKit.def:
     16        * WebKit.vcproj/WebKit_debug.def:
     17
    1182008-10-29  Jon Honeycutt  <jhoneycutt@apple.com>
    219
  • trunk/WebKit/win/WebKit.vcproj/WebKit.def

    r37978 r37990  
    109109        ??1Mutex@WTF@@QAE@XZ
    110110        ??1ThreadCondition@WTF@@QAE@XZ
    111         ?atomicallyInitializedStaticMutex@WTF@@3PAVMutex@1@A
    112111        ?broadcast@ThreadCondition@WTF@@QAEXXZ
    113112        ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
     
    119118        ?isMainThread@WTF@@YA_NXZ
    120119        ?lock@Mutex@WTF@@QAEXXZ
     120        ?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
    121121        ?signal@ThreadCondition@WTF@@QAEXXZ
    122122        ?tryLock@Mutex@WTF@@QAE_NXZ
    123123        ?unlock@Mutex@WTF@@QAEXXZ
     124        ?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
    124125        ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
    125126        ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
  • trunk/WebKit/win/WebKit.vcproj/WebKit_debug.def

    r37978 r37990  
    109109        ??1Mutex@WTF@@QAE@XZ
    110110        ??1ThreadCondition@WTF@@QAE@XZ
    111         ?atomicallyInitializedStaticMutex@WTF@@3PAVMutex@1@A
    112111        ?broadcast@ThreadCondition@WTF@@QAEXXZ
    113112        ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
     
    119118        ?isMainThread@WTF@@YA_NXZ
    120119        ?lock@Mutex@WTF@@QAEXXZ
     120        ?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ       
    121121        ?signal@ThreadCondition@WTF@@QAEXXZ
    122122        ?tryLock@Mutex@WTF@@QAE_NXZ
    123123        ?unlock@Mutex@WTF@@QAEXXZ
     124        ?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
    124125        ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
    125126        ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
Note: See TracChangeset for help on using the changeset viewer.