Bug 133010 - [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection
Summary: [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-16 14:33 PDT by Andy Estes
Modified: 2014-05-19 11:00 PDT (History)
0 users

See Also:


Attachments
[WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection (4.08 KB, patch)
2014-05-16 14:36 PDT, Andy Estes
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2014-05-16 14:33:26 PDT
[WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection
Comment 1 Andy Estes 2014-05-16 14:36:16 PDT
Created attachment 231591 [details]
[WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection
Comment 2 Geoffrey Garen 2014-05-16 14:47:27 PDT
Comment on attachment 231591 [details]
[WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection

View in context: https://bugs.webkit.org/attachment.cgi?id=231591&action=review

r=me

> Source/WebKit2/ChangeLog:27
> +2014-05-16  Andy Estes  <aestes@apple.com>
> +
> +        Need a short description (OOPS!).
> +        Need the bug URL (OOPS!).
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        * Platform/IPC/Connection.cpp:
> +        (IPC::Connection::Connection):
> +        (IPC::Connection::waitForMessage):
> +        (IPC::Connection::connectionDidClose):
> +        * Platform/IPC/Connection.h:

ChangeLog conflict-o.

> Source/WebKit2/Platform/IPC/Connection.cpp:682
> +        m_waitForMessageCondition.notify_all();
> +    }

It is an optimization to drop the lock *before* calling notify_all(). Otherwise, you will wake a thread and it will promptly sleep again due to failing to acquire the locked mutex.

Please move the call to notify_all() out of the lock scope.
Comment 3 Andy Estes 2014-05-19 11:00:54 PDT
Committed r169051: <http://trac.webkit.org/changeset/169051>