Changeset 38850 in webkit
- Timestamp:
- Nov 30, 2008 12:31:11 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r38847 r38850 1 2008-11-30 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=22530 6 Assertion failures seen on buildbot due to uninitialized WorkerThread::m_threadID 7 8 * dom/WorkerThread.cpp: 9 (WebCore::WorkerThread::start): Protect worker startup with a mutex to ensure that this 10 function runs to completion before the thread begins execution. 11 (WebCore::WorkerThread::workerThread): Updated comments. 12 (WebCore::WorkerThread::stop): Ditto. 13 * dom/WorkerThread.h: Renamed m_workerContextMutex to m_threadCreationMutex, because it now 14 protects startup as a whole. 15 16 * storage/DatabaseThread.cpp: 17 * storage/DatabaseThread.h: 18 * storage/LocalStorageThread.cpp: 19 * storage/LocalStorageThread.h: 20 Fixed the same m_threadID problem. 21 1 22 2008-11-29 Brent Fulgham <bfulgham@gmail.com> 2 23 -
trunk/WebCore/dom/WorkerThread.cpp
r38746 r38850 60 60 bool WorkerThread::start() 61 61 { 62 // Mutex protection is necessary to ensure that m_threadID is initialized when the thread starts. 63 MutexLocker lock(m_threadCreationMutex); 64 62 65 if (m_threadID) 63 66 return true; … … 76 79 { 77 80 { 78 // Mutex protection is necessary because stop() can be called before the context is fully created. 79 MutexLocker lock(m_workerContextMutex); 81 MutexLocker lock(m_threadCreationMutex); 80 82 m_workerContext = WorkerContext::create(m_scriptURL, this); 81 83 } … … 106 108 void WorkerThread::stop() 107 109 { 108 MutexLocker lock(m_workerContextMutex); 110 // Mutex protection is necessary because stop() can be called before the context is fully created. 111 MutexLocker lock(m_threadCreationMutex); 112 109 113 // Ensure that tasks are being handled by thread event loop. If script execution weren't forbidden, a while(1) loop in JS could keep the thread alive forever. 110 114 if (m_workerContext) -
trunk/WebCore/dom/WorkerThread.h
r38729 r38850 66 66 67 67 RefPtr<WorkerContext> m_workerContext; 68 Mutex m_ workerContextMutex;68 Mutex m_threadCreationMutex; 69 69 70 70 MessageQueue<RefPtr<WorkerTask> > m_messageQueue; -
trunk/WebCore/storage/DatabaseThread.cpp
r35419 r38850 49 49 bool DatabaseThread::start() 50 50 { 51 MutexLocker lock(m_threadCreationMutex); 52 51 53 if (m_threadID) 52 54 return true; … … 76 78 void* DatabaseThread::databaseThread() 77 79 { 78 LOG(StorageAPI, "Starting DatabaseThread %p", this); 80 { 81 // Wait for DatabaseThread::start() to complete. 82 MutexLocker lock(m_threadCreationMutex); 83 LOG(StorageAPI, "Started DatabaseThread %p", this); 84 } 79 85 80 86 AutodrainedPool pool; -
trunk/WebCore/storage/DatabaseThread.h
r31971 r38850 35 35 #include <wtf/PassRefPtr.h> 36 36 #include <wtf/RefPtr.h> 37 #include <wtf/Threading.h> 37 38 38 39 namespace WebCore { … … 62 63 void* databaseThread(); 63 64 65 Mutex m_threadCreationMutex; 64 66 ThreadIdentifier m_threadID; 65 67 RefPtr<DatabaseThread> m_selfRef; -
trunk/WebCore/storage/LocalStorageThread.cpp
r35419 r38850 46 46 bool LocalStorageThread::start() 47 47 { 48 MutexLocker lock(m_threadCreationMutex); 49 48 50 if (m_threadID) 49 51 return true; … … 61 63 void* LocalStorageThread::localStorageThread() 62 64 { 65 { 66 // Wait for LocalStorageThread::start() to complete. 67 MutexLocker lock(m_threadCreationMutex); 68 } 69 63 70 while (true) { 64 71 RefPtr<LocalStorageTask> task; -
trunk/WebCore/storage/LocalStorageThread.h
r32918 r38850 60 60 void* localStorageThread(); 61 61 62 Mutex m_threadCreationMutex; 62 63 ThreadIdentifier m_threadID; 63 64 RefPtr<LocalStorageThread> m_selfRef;
Note: See TracChangeset
for help on using the changeset viewer.