Bug 141820 - RunLoop::dispatch() should drop the mutex before calling wakeUp().
Summary: RunLoop::dispatch() should drop the mutex before calling wakeUp().
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-19 18:03 PST by Simon Fraser (smfr)
Modified: 2015-02-20 11:36 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.33 KB, patch)
2015-02-19 18:32 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-02-19 18:03:24 PST
It's possible for RunLoop::performWork() to return without handling all the functions in the queue. In that case, CF is going to unset the CFRunLoopSource "signaled" state, which means that source won't get processed again until RunLoop::dispatch is called.

We should re-signal the source at the end of RunLoop::performWork() if there's still work to do. This is OK, because CF unsets the signaled bit before it calls us.

Also, RunLoop::dispatch() should drop the mutex before calling wakeUp().
Comment 1 Simon Fraser (smfr) 2015-02-19 18:28:34 PST
Never mind. If something was added to the m_functionQueue inside of RunLoop::performWork(), it would have had to have been via RunLoop::dispatch, which would have signaled.

So I'll just keep this for the mutex fix.
Comment 2 Simon Fraser (smfr) 2015-02-19 18:32:31 PST
Created attachment 246931 [details]
Patch
Comment 3 WebKit Commit Bot 2015-02-20 11:36:13 PST
Comment on attachment 246931 [details]
Patch

Clearing flags on attachment: 246931

Committed r180434: <http://trac.webkit.org/changeset/180434>
Comment 4 WebKit Commit Bot 2015-02-20 11:36:18 PST
All reviewed patches have been landed.  Closing bug.