| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // Mutex protection is necessary because stop() can be called before the con
text is fully created. | 260 // Mutex protection is necessary because stop() can be called before the con
text is fully created. |
| 261 MutexLocker lock(m_threadCreationMutex); | 261 MutexLocker lock(m_threadCreationMutex); |
| 262 | 262 |
| 263 // Ensure that tasks are being handled by thread event loop. If script execu
tion weren't forbidden, a while(1) loop in JS could keep the thread alive foreve
r. | 263 // Ensure that tasks are being handled by thread event loop. If script execu
tion weren't forbidden, a while(1) loop in JS could keep the thread alive foreve
r. |
| 264 if (m_workerContext) { | 264 if (m_workerContext) { |
| 265 m_workerContext->script()->scheduleExecutionTermination(); | 265 m_workerContext->script()->scheduleExecutionTermination(); |
| 266 | 266 |
| 267 #if ENABLE(SQL_DATABASE) | 267 #if ENABLE(SQL_DATABASE) |
| 268 DatabaseManager::manager().interruptAllDatabasesForContext(m_workerConte
xt.get()); | 268 DatabaseManager::manager().interruptAllDatabasesForContext(m_workerConte
xt.get()); |
| 269 #endif | 269 #endif |
| 270 m_runLoop.postTask(WorkerThreadShutdownStartTask::create()); | 270 m_runLoop.postTaskAndTerminate(WorkerThreadShutdownStartTask::create()); |
| 271 return; |
| 271 } | 272 } |
| 272 m_runLoop.terminate(); | 273 m_runLoop.terminate(); |
| 273 } | 274 } |
| 274 | 275 |
| 275 } // namespace WebCore | 276 } // namespace WebCore |
| 276 | 277 |
| 277 #endif // ENABLE(WORKERS) | 278 #endif // ENABLE(WORKERS) |
| OLD | NEW |