Changeset 38411 in webkit for trunk/JavaScriptCore/wtf
- Timestamp:
- Nov 14, 2008, 5:29:33 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/wtf
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/MainThread.cpp
r38101 r38411 30 30 #include "MainThread.h" 31 31 32 #include "StdLibExtras.h" 32 33 #include "Threading.h" 33 34 #include "Vector.h" … … 54 55 Mutex& mainThreadFunctionQueueMutex() 55 56 { 56 static Mutex& staticMutex = *new Mutex;57 DEFINE_STATIC_LOCAL(Mutex, staticMutex, ()); 57 58 return staticMutex; 58 59 } … … 60 61 static FunctionQueue& functionQueue() 61 62 { 62 static FunctionQueue& staticFunctionQueue = *new FunctionQueue;63 DEFINE_STATIC_LOCAL(FunctionQueue, staticFunctionQueue, ()); 63 64 return staticFunctionQueue; 64 65 } -
trunk/JavaScriptCore/wtf/ThreadingPthreads.cpp
r38101 r38411 30 30 #include "Threading.h" 31 31 32 #include "StdLibExtras.h" 33 32 34 #if USE(PTHREADS) 33 35 … … 41 43 namespace WTF { 42 44 45 typedef HashMap<ThreadIdentifier, pthread_t> ThreadMap; 46 43 47 static Mutex* atomicallyInitializedStaticMutex; 44 48 … … 49 53 static Mutex& threadMapMutex() 50 54 { 51 static Mutex& mutex = *new Mutex;55 DEFINE_STATIC_LOCAL(Mutex, mutex, ()); 52 56 return mutex; 53 57 } … … 77 81 } 78 82 79 static HashMap<ThreadIdentifier, pthread_t>& threadMap()80 { 81 static HashMap<ThreadIdentifier, pthread_t>& map = *new HashMap<ThreadIdentifier, pthread_t>;83 static ThreadMap& threadMap() 84 { 85 DEFINE_STATIC_LOCAL(ThreadMap, map, ()); 82 86 return map; 83 87 } … … 98 102 MutexLocker locker(threadMapMutex()); 99 103 100 HashMap<ThreadIdentifier, pthread_t>::iterator i = threadMap().begin();104 ThreadMap::iterator i = threadMap().begin(); 101 105 for (; i != threadMap().end(); ++i) { 102 106 if (pthread_equal(i->second, pthreadHandle))
Note:
See TracChangeset
for help on using the changeset viewer.