Changeset 38101 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 4, 2008, 10:57:01 AM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r38096 r38101 1 2008-11-03 Darin Adler <[email protected]> 2 3 Reviewed by Tim Hatcher. 4 5 - https://bugs.webkit.org/show_bug.cgi?id=22061 6 create script to check for exit-time destructors 7 8 * JavaScriptCore.exp: Changed to export functions rather than 9 a global for the atomically initialized static mutex. 10 11 * JavaScriptCore.xcodeproj/project.pbxproj: Added a script 12 phase that runs the check-for-exit-time-destructors script. 13 14 * wtf/MainThread.cpp: 15 (WTF::mainThreadFunctionQueueMutex): Changed to leak an object 16 rather than using an exit time destructor. 17 (WTF::functionQueue): Ditto. 18 * wtf/unicode/icu/CollatorICU.cpp: 19 (WTF::cachedCollatorMutex): Ditto. 20 21 * wtf/Threading.h: Changed other platforms to share the Windows 22 approach where the mutex is internal and the functions are exported. 23 * wtf/ThreadingGtk.cpp: 24 (WTF::lockAtomicallyInitializedStaticMutex): Ditto. 25 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 26 * wtf/ThreadingNone.cpp: 27 (WTF::lockAtomicallyInitializedStaticMutex): Ditto. 28 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 29 * wtf/ThreadingPthreads.cpp: 30 (WTF::threadMapMutex): Changed to leak an object rather than using 31 an exit time destructor. 32 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change. 33 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 34 (WTF::threadMap): Changed to leak an object rather than using 35 an exit time destructor. 36 * wtf/ThreadingQt.cpp: 37 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change. 38 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 39 * wtf/ThreadingWin.cpp: 40 (WTF::lockAtomicallyInitializedStaticMutex): Added an assertion. 41 1 42 2008-11-04 Adam Roben <[email protected]> 2 43 -
trunk/JavaScriptCore/JavaScriptCore.exp
r38060 r38101 290 290 __ZN3WTF27releaseFastMallocFreeMemoryEv 291 291 __ZN3WTF28setMainThreadCallbacksPausedEb 292 __ZN3WTF32atomicallyInitializedStaticMutexE 292 __ZN3WTF36lockAtomicallyInitializedStaticMutexEv 293 __ZN3WTF38unlockAtomicallyInitializedStaticMutexEv 293 294 __ZN3WTF5Mutex4lockEv 294 295 __ZN3WTF5Mutex6unlockEv -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r38095 r38101 1618 1618 932F5B910822A1C700736975 /* Sources */, 1619 1619 9319586B09D9F91A00A56FD4 /* Check For Global Initializers */, 1620 933457200EBFDC3F00B80894 /* Check For Exit Time Destructors */, 1620 1621 5D29D8BE0E9860B400C3D2D0 /* Check For Weak VTables */, 1621 1622 932F5BD20822A1C700736975 /* Frameworks */, … … 1807 1808 shellPath = /bin/sh; 1808 1809 shellScript = "if [ -f ../WebKitTools/Scripts/check-for-global-initializers ]; then\n ../WebKitTools/Scripts/check-for-global-initializers || exit $?\nfi"; 1810 }; 1811 933457200EBFDC3F00B80894 /* Check For Exit Time Destructors */ = { 1812 isa = PBXShellScriptBuildPhase; 1813 buildActionMask = 2147483647; 1814 files = ( 1815 ); 1816 inputPaths = ( 1817 ); 1818 name = "Check For Exit Time Destructors"; 1819 outputPaths = ( 1820 ); 1821 runOnlyForDeploymentPostprocessing = 0; 1822 shellPath = /bin/sh; 1823 shellScript = "if [ -f ../WebKitTools/Scripts/check-for-exit-time-destructors ]; then\n ../WebKitTools/Scripts/check-for-exit-time-destructors || exit $?\nfi"; 1809 1824 }; 1810 1825 /* End PBXShellScriptBuildPhase section */ -
trunk/JavaScriptCore/wtf/MainThread.cpp
r36056 r38101 50 50 typedef Vector<FunctionWithContext> FunctionQueue; 51 51 52 static bool callbacksPaused; // This global varia lble is only accessed from main thread.52 static bool callbacksPaused; // This global variable is only accessed from main thread. 53 53 54 54 Mutex& mainThreadFunctionQueueMutex() 55 55 { 56 static Mutex staticMutex;56 static Mutex& staticMutex = *new Mutex; 57 57 return staticMutex; 58 58 } … … 60 60 static FunctionQueue& functionQueue() 61 61 { 62 static FunctionQueue staticFunctionQueue;62 static FunctionQueue& staticFunctionQueue = *new FunctionQueue; 63 63 return staticFunctionQueue; 64 64 } -
trunk/JavaScriptCore/wtf/Threading.h
r38053 r38101 252 252 void initializeThreading(); 253 253 254 #if !PLATFORM(WIN_OS) || PLATFORM(WX)255 extern Mutex* atomicallyInitializedStaticMutex;256 inline void lockAtomicallyInitializedStaticMutex() { atomicallyInitializedStaticMutex->lock(); }257 inline void unlockAtomicallyInitializedStaticMutex() { atomicallyInitializedStaticMutex->unlock(); }258 #else259 254 void lockAtomicallyInitializedStaticMutex(); 260 255 void unlockAtomicallyInitializedStaticMutex(); 261 #endif262 256 263 257 } // namespace WTF -
trunk/JavaScriptCore/wtf/ThreadingGtk.cpp
r37732 r38101 41 41 namespace WTF { 42 42 43 Mutex* atomicallyInitializedStaticMutex;43 static Mutex* atomicallyInitializedStaticMutex; 44 44 45 45 static ThreadIdentifier mainThreadIdentifier; … … 64 64 initializeMainThread(); 65 65 } 66 } 67 68 void lockAtomicallyInitializedStaticMutex() 69 { 70 ASSERT(atomicallyInitializedStaticMutex); 71 atomicallyInitializedStaticMutex->lock(); 72 } 73 74 void unlockAtomicallyInitializedStaticMutex() 75 { 76 atomicallyInitializedStaticMutex->unlock(); 66 77 } 67 78 -
trunk/JavaScriptCore/wtf/ThreadingNone.cpp
r35419 r38101 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 #include "config.h" 30 31 #include "Threading.h" 31 32 32 33 namespace WTF { 33 34 Mutex* atomicallyInitializedStaticMutex;35 34 36 35 void initializeThreading() {} … … 45 44 void Mutex::lock() {} 46 45 bool Mutex::tryLock() { return false; } 47 void Mutex::unlock() {} ;46 void Mutex::unlock() {} 48 47 49 48 ThreadCondition::ThreadCondition() {} … … 54 53 void ThreadCondition::broadcast() {} 55 54 55 void lockAtomicallyInitializedStaticMutex() {} 56 void unlockAtomicallyInitializedStaticMutex() { } 57 56 58 } // namespace WebCore -
trunk/JavaScriptCore/wtf/ThreadingPthreads.cpp
r37732 r38101 41 41 namespace WTF { 42 42 43 Mutex* atomicallyInitializedStaticMutex;43 static Mutex* atomicallyInitializedStaticMutex; 44 44 45 45 #if !PLATFORM(DARWIN) … … 49 49 static Mutex& threadMapMutex() 50 50 { 51 static Mutex mutex;51 static Mutex& mutex = *new Mutex; 52 52 return mutex; 53 53 } … … 66 66 } 67 67 68 void lockAtomicallyInitializedStaticMutex() 69 { 70 ASSERT(atomicallyInitializedStaticMutex); 71 atomicallyInitializedStaticMutex->lock(); 72 } 73 74 void unlockAtomicallyInitializedStaticMutex() 75 { 76 atomicallyInitializedStaticMutex->unlock(); 77 } 78 68 79 static HashMap<ThreadIdentifier, pthread_t>& threadMap() 69 80 { 70 static HashMap<ThreadIdentifier, pthread_t> map;81 static HashMap<ThreadIdentifier, pthread_t>& map = *new HashMap<ThreadIdentifier, pthread_t>; 71 82 return map; 72 83 } -
trunk/JavaScriptCore/wtf/ThreadingQt.cpp
r37040 r38101 65 65 66 66 67 Mutex* atomicallyInitializedStaticMutex;67 static Mutex* atomicallyInitializedStaticMutex; 68 68 69 69 static ThreadIdentifier mainThreadIdentifier; … … 123 123 void initializeThreading() 124 124 { 125 if (!atomicallyInitializedStaticMutex) {125 if (!atomicallyInitializedStaticMutex) { 126 126 atomicallyInitializedStaticMutex = new Mutex; 127 127 threadMapMutex(); … … 135 135 } 136 136 137 void lockAtomicallyInitializedStaticMutex() 138 { 139 ASSERT(atomicallyInitializedStaticMutex); 140 atomicallyInitializedStaticMutex->lock(); 141 } 142 143 void unlockAtomicallyInitializedStaticMutex() 144 { 145 atomicallyInitializedStaticMutex->unlock(); 146 } 147 137 148 ThreadIdentifier createThread(ThreadFunction entryPoint, void* data, const char*) 138 149 { -
trunk/JavaScriptCore/wtf/ThreadingWin.cpp
r37990 r38101 112 112 void lockAtomicallyInitializedStaticMutex() 113 113 { 114 ASSERT(atomicallyInitializedStaticMutex); 114 115 atomicallyInitializedStaticMutex->lock(); 115 116 } -
trunk/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp
r31575 r38101 46 46 static Mutex& cachedCollatorMutex() 47 47 { 48 AtomicallyInitializedStatic(Mutex , mutex);48 AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); 49 49 return mutex; 50 50 }
Note:
See TracChangeset
for help on using the changeset viewer.