diff options
Diffstat (limited to 'WebCore/loader/icon/IconDatabase.cpp')
-rw-r--r-- | WebCore/loader/icon/IconDatabase.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/WebCore/loader/icon/IconDatabase.cpp b/WebCore/loader/icon/IconDatabase.cpp index 63b9c64..f708622 100644 --- a/WebCore/loader/icon/IconDatabase.cpp +++ b/WebCore/loader/icon/IconDatabase.cpp @@ -768,6 +768,7 @@ IconDatabase::IconDatabase() , m_threadTerminationRequested(false) , m_removeIconsRequested(false) , m_iconURLImportComplete(false) + , m_disabledSuddenTerminationForSyncThread(false) , m_initialPruningComplete(false) , m_client(defaultClient()) , m_imported(false) @@ -806,13 +807,17 @@ void IconDatabase::notifyPendingLoadDecisions() void IconDatabase::wakeSyncThread() { - // The following is balanced by the call to enableSuddenTermination in the - // syncThreadMainLoop function. - // FIXME: It would be better to only disable sudden termination if we have - // something to write, not just if we have something to read. - disableSuddenTermination(); - MutexLocker locker(m_syncLock); + + if (!m_disabledSuddenTerminationForSyncThread) { + m_disabledSuddenTerminationForSyncThread = true; + // The following is balanced by the call to enableSuddenTermination in the + // syncThreadMainLoop function. + // FIXME: It would be better to only disable sudden termination if we have + // something to write, not just if we have something to read. + disableSuddenTermination(); + } + m_syncCondition.signal(); } @@ -1411,7 +1416,9 @@ void* IconDatabase::syncThreadMainLoop() // The following is balanced by the call to disableSuddenTermination in the // wakeSyncThread function. Any time we wait on the condition, we also have // to enableSuddenTermation, after doing the next batch of work. + ASSERT(m_disabledSuddenTerminationForSyncThread); enableSuddenTermination(); + m_disabledSuddenTerminationForSyncThread = false; } m_syncCondition.wait(m_syncLock); @@ -1428,7 +1435,9 @@ void* IconDatabase::syncThreadMainLoop() // The following is balanced by the call to disableSuddenTermination in the // wakeSyncThread function. Any time we wait on the condition, we also have // to enableSuddenTermation, after doing the next batch of work. + ASSERT(m_disabledSuddenTerminationForSyncThread); enableSuddenTermination(); + m_disabledSuddenTerminationForSyncThread = false; } return 0; |