OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2013 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 MutexLocker lock(m_terminationRequestedMutex); | 90 MutexLocker lock(m_terminationRequestedMutex); |
91 ASSERT(!m_terminationRequested); | 91 ASSERT(!m_terminationRequested); |
92 m_terminationRequested = true; | 92 m_terminationRequested = true; |
93 m_cleanupSync = cleanupSync; | 93 m_cleanupSync = cleanupSync; |
94 WTF_LOG(StorageAPI, "DatabaseThread %p was asked to terminate\n", this); | 94 WTF_LOG(StorageAPI, "DatabaseThread %p was asked to terminate\n", this); |
95 m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThread
, this))); | 95 m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThread
, this))); |
96 } | 96 } |
97 | 97 |
98 bool DatabaseThread::terminationRequested(TaskSynchronizer* taskSynchronizer) co
nst | 98 bool DatabaseThread::terminationRequested(TaskSynchronizer* taskSynchronizer) co
nst |
99 { | 99 { |
100 #ifndef NDEBUG | 100 #if ENABLE(ASSERT) |
101 if (taskSynchronizer) | 101 if (taskSynchronizer) |
102 taskSynchronizer->setHasCheckedForTermination(); | 102 taskSynchronizer->setHasCheckedForTermination(); |
103 #endif | 103 #endif |
104 | 104 |
105 MutexLocker lock(m_terminationRequestedMutex); | 105 MutexLocker lock(m_terminationRequestedMutex); |
106 return m_terminationRequested; | 106 return m_terminationRequested; |
107 } | 107 } |
108 | 108 |
109 void DatabaseThread::cleanupDatabaseThread() | 109 void DatabaseThread::cleanupDatabaseThread() |
110 { | 110 { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task) | 166 void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task) |
167 { | 167 { |
168 ASSERT(m_thread); | 168 ASSERT(m_thread); |
169 ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination()); | 169 ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination()); |
170 // WebThread takes ownership of the task. | 170 // WebThread takes ownership of the task. |
171 m_thread->postTask(task.leakPtr()); | 171 m_thread->postTask(task.leakPtr()); |
172 } | 172 } |
173 | 173 |
174 } // namespace WebCore | 174 } // namespace WebCore |
OLD | NEW |