| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); | 133 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); |
| 134 | 134 |
| 135 runEventLoop(); | 135 runEventLoop(); |
| 136 | 136 |
| 137 ThreadIdentifier threadID = m_threadID; | 137 ThreadIdentifier threadID = m_threadID; |
| 138 | 138 |
| 139 ASSERT(m_workerGlobalScope->hasOneRef()); | 139 ASSERT(m_workerGlobalScope->hasOneRef()); |
| 140 | 140 |
| 141 // The below assignment will destroy the context, which will in turn notify
messaging proxy. | 141 // The below assignment will destroy the context, which will in turn notify
messaging proxy. |
| 142 // We cannot let any objects survive past thread exit, because no other thre
ad will run GC or otherwise destroy them. | 142 // We cannot let any objects survive past thread exit, because no other thre
ad will run GC or otherwise destroy them. |
| 143 m_workerGlobalScope = 0; | 143 m_workerGlobalScope = nullptr; |
| 144 | 144 |
| 145 // Cleanup thread heap which causes all objects to be finalized. | 145 // Cleanup thread heap which causes all objects to be finalized. |
| 146 // After this call thread heap must be empty. | 146 // After this call thread heap must be empty. |
| 147 ThreadState::current()->cleanup(); | 147 ThreadState::current()->cleanup(); |
| 148 | 148 |
| 149 // Clean up PlatformThreadData before WTF::WTFThreadData goes away! | 149 // Clean up PlatformThreadData before WTF::WTFThreadData goes away! |
| 150 PlatformThreadData::current().destroy(); | 150 PlatformThreadData::current().destroy(); |
| 151 | 151 |
| 152 // The thread object may be already destroyed from notification now, don't t
ry to access "this". | 152 // The thread object may be already destroyed from notification now, don't t
ry to access "this". |
| 153 detachThread(threadID); | 153 detachThread(threadID); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 void WorkerThread::releaseFastMallocFreeMemoryInAllThreads() | 249 void WorkerThread::releaseFastMallocFreeMemoryInAllThreads() |
| 250 { | 250 { |
| 251 MutexLocker lock(threadSetMutex()); | 251 MutexLocker lock(threadSetMutex()); |
| 252 HashSet<WorkerThread*>& threads = workerThreads(); | 252 HashSet<WorkerThread*>& threads = workerThreads(); |
| 253 HashSet<WorkerThread*>::iterator end = threads.end(); | 253 HashSet<WorkerThread*>::iterator end = threads.end(); |
| 254 for (HashSet<WorkerThread*>::iterator it = threads.begin(); it != end; ++it) | 254 for (HashSet<WorkerThread*>::iterator it = threads.begin(); it != end; ++it) |
| 255 (*it)->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask))
; | 255 (*it)->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask))
; |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace WebCore | 258 } // namespace WebCore |
| OLD | NEW |