Changeset 63912 in webkit


Ignore:
Timestamp:
Jul 22, 2010 2:25:13 PM (14 years ago)
Author:
Adam Roben
Message:

Make WorkQueue aware of potential errors with ::WaitForMultipleObjects

Fixes <http://webkit.org/b/42846> WorkQueue should detect
::WaitForMultipleObject failures

Reviewed by Anders Carlsson.

  • Platform/win/WorkQueueWin.cpp:

(WorkQueue::workQueueThreadBody): Added some assertions about the
various things that can fail with ::WaitForMultipleObjects,
specifically:

  • Passing too many objects
  • Timeouts (which shouldn't happen since we pass a timeout interval of INFINITE)
  • Abandoned mutexes (which shouldn't happen since we don't wait on any mutexes currently)
  • Miscellaneous failures
Location:
trunk/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r63904 r63912  
     12010-07-22  Adam Roben  <aroben@apple.com>
     2
     3        Make WorkQueue aware of potential errors with ::WaitForMultipleObjects
     4
     5        Fixes <http://webkit.org/b/42846> WorkQueue should detect
     6        ::WaitForMultipleObject failures
     7
     8        Reviewed by Anders Carlsson.
     9
     10        * Platform/win/WorkQueueWin.cpp:
     11        (WorkQueue::workQueueThreadBody): Added some assertions about the
     12        various things that can fail with ::WaitForMultipleObjects,
     13        specifically:
     14          - Passing too many objects
     15          - Timeouts (which shouldn't happen since we pass a timeout interval
     16            of INFINITE)
     17          - Abandoned mutexes (which shouldn't happen since we don't wait on
     18            any mutexes currently)
     19          - Miscellaneous failures
     20
    1212010-07-22  Sam Weinig  <sam@webkit.org>
    222
  • trunk/WebKit2/Platform/win/WorkQueueWin.cpp

    r63174 r63912  
    6060        handles.append(m_performWorkEvent);
    6161
     62        ASSERT(handles.size() <= MAXIMUM_WAIT_OBJECTS);
     63
    6264        // Now we wait.
    6365        DWORD result = ::WaitForMultipleObjects(handles.size(), handles.data(), FALSE, INFINITE);
     66        if (result == WAIT_FAILED) {
     67            DWORD error = ::GetLastError();
     68            ASSERT_NOT_REACHED();
     69        }
     70
     71        // The wait should never time out since we passed INFINITE for the timeout interval.
     72        ASSERT(result != WAIT_TIMEOUT);
     73        // We don't know how (or need) to handle abandoned mutexes yet.
     74        ASSERT(result < WAIT_ABANDONED_0 || result >= WAIT_ABANDONED_0 + handles.size());
    6475
    6576        if (result == handles.size() - 1)
Note: See TracChangeset for help on using the changeset viewer.