Bug 23926

Summary: Race condition in callOnMainThreadAndWait
Product: WebKit Reporter: David Levin <levin>
Component: Web Template FrameworkAssignee: David Levin <levin>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, levin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch for bug.
none
Patch to remove unused function. darin: review+

David Levin
Reported 2009-02-12 10:03:50 PST
In callOnMainThreadAndWait, if MainThreadFunction finishes before the wait is entered, then the sync() call has no effect. (Thanks to Alexey for pointing out the same problem elsewhere.)
Attachments
Patch for bug. (1.84 KB, patch)
2009-02-12 10:24 PST, David Levin
no flags
Patch to remove unused function. (2.99 KB, patch)
2009-02-12 14:18 PST, David Levin
darin: review+
David Levin
Comment 1 2009-02-12 10:24:55 PST
Created attachment 27606 [details] Patch for bug.
Dmitry Titov
Comment 2 2009-02-12 10:40:26 PST
It would be nice to change callOnMainThread function to match the same style too (remove local scope for the mutex and needToSchedule variable).
David Levin
Comment 3 2009-02-12 12:51:59 PST
Comment on attachment 27606 [details] Patch for bug. Retracting while I consider dimich's suggestion.
David Levin
Comment 4 2009-02-12 14:18:51 PST
Created attachment 27623 [details] Patch to remove unused function. callOnMainThreadAndWait isn't used and it has a race in it.
Darin Adler
Comment 5 2009-02-12 14:42:23 PST
Comment on attachment 27623 [details] Patch to remove unused function. r=me Seems to me we can add a version without the race if we find we need it for something.
Alexey Proskuryakov
Comment 6 2009-02-13 01:29:43 PST
Committed revision 40969.
Note You need to log in before you can comment on or make changes to this bug.