[webkit-reviews] review granted: [Bug 133010] [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection : [Attachment 231591] [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 16 14:47:04 PDT 2014


Geoffrey Garen <ggaren at apple.com> has granted Andy Estes <aestes at apple.com>'s
request for review:
Bug 133010: [WebKit2] Wake up threads blocked in
waitForAndDispatchImmediately() if we lose our connection
https://bugs.webkit.org/show_bug.cgi?id=133010

Attachment 231591: [WebKit2] Wake up threads blocked in
waitForAndDispatchImmediately() if we lose our connection
https://bugs.webkit.org/attachment.cgi?id=231591&action=review

------- Additional Comments from Geoffrey Garen <ggaren at apple.com>
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 at 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.


More information about the webkit-reviews mailing list