Changeset 95961 in webkit


Ignore:
Timestamp:
Sep 26, 2011 10:36:19 AM (13 years ago)
Author:
mrowe@apple.com
Message:

<http://webkit.org/b/68809> IconDatabase::syncThreadMainLoop can assert if wakeSyncThread is called before thread starts executing

If wakeSyncThread is called before syncThreadMainLoop starts executing then m_syncThreadHasWorkToDo would be set
while executing the body of the sync thread loop, causing us to skip blocking on the condition variable. This would
lead to us hitting the assertion failure due to m_disabledSuddenTerminationForSyncThread being false, unless the main
thread happened to call wakeSyncThread a second time while the first loop iteration was executing.

Reviewed by Anders Carlsson.

  • loader/icon/IconDatabase.cpp:

(WebCore::IconDatabase::syncThreadMainLoop): Clear m_syncThreadHasWorkToDo to indicate that we're about to perform
all pending work.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95960 r95961  
     12011-09-26  Mark Rowe  <mrowe@apple.com>
     2
     3        <http://webkit.org/b/68809> IconDatabase::syncThreadMainLoop can assert if wakeSyncThread is called before thread starts executing
     4
     5        If wakeSyncThread is called before syncThreadMainLoop starts executing then m_syncThreadHasWorkToDo would be set
     6        while executing the body of the sync thread loop, causing us to skip blocking on the condition variable. This would
     7        lead to us hitting the assertion failure due to m_disabledSuddenTerminationForSyncThread being false, unless the main
     8        thread happened to call wakeSyncThread a second time while the first loop iteration was executing.
     9
     10        Reviewed by Anders Carlsson.
     11
     12        * loader/icon/IconDatabase.cpp:
     13        (WebCore::IconDatabase::syncThreadMainLoop): Clear m_syncThreadHasWorkToDo to indicate that we're about to perform
     14        all pending work.
     15
    1162011-09-26  Antaryami Pandia  <antaryami.pandia@motorola.com>
    217
  • trunk/Source/WebCore/loader/icon/IconDatabase.cpp

    r95929 r95961  
    13571357    bool shouldReenableSuddenTermination = m_disabledSuddenTerminationForSyncThread;
    13581358    m_disabledSuddenTerminationForSyncThread = false;
     1359
     1360    // We'll either do any pending work on our first pass through the loop, or we'll terminate
     1361    // without doing any work. Either way we're dealing with any currently-pending work.
     1362    m_syncThreadHasWorkToDo = false;
    13591363
    13601364    // It's possible thread termination is requested before the main loop even starts - in that case, just skip straight to cleanup
Note: See TracChangeset for help on using the changeset viewer.