RESOLVED FIXED 23374
Add RunLoop class to encapsulate the loop in Worker threads.
https://bugs.webkit.org/show_bug.cgi?id=23374
Summary Add RunLoop class to encapsulate the loop in Worker threads.
Dmitry Titov
Reported 2009-01-15 20:01:19 PST
This class will also keep a heap of TimerBase objects that are scheduled to fire on a Worker's thread.
Attachments
Proposed patch, part 1 (15.24 KB, patch)
2009-01-20 17:09 PST, Dmitry Titov
no flags
revised patch (15.41 KB, patch)
2009-01-21 14:29 PST, Dmitry Titov
no flags
hopefully the last version (15.47 KB, patch)
2009-01-21 14:42 PST, Dmitry Titov
ap: review+
Final version (15.46 KB, patch)
2009-01-23 01:14 PST, Dmitry Titov
no flags
Dmitry Titov
Comment 1 2009-01-20 17:09:39 PST
Created attachment 26878 [details] Proposed patch, part 1 This patch adds WorkerRunLoop which is used in WorkerThread. No change in functionality, just add a new class. The second part will add timers and timedWait usage.
Dmitry Titov
Comment 2 2009-01-21 14:29:17 PST
Created attachment 26905 [details] revised patch Oops, fixed couple of small things: - removed 2008 from license text - removed arguments to methods in .h file where their meaning can be understood from the type - added comment - added ASSERT to WorkerRunLoop::run() to verify it's called on a context with the thread and the thread is the current one
Dmitry Titov
Comment 3 2009-01-21 14:42:08 PST
Created attachment 26906 [details] hopefully the last version Sorry for spam :-( Needed to add 2 include files for the new asserts to compile. Seems it's ready for review now.
Alexey Proskuryakov
Comment 4 2009-01-23 00:49:59 PST
Comment on attachment 26906 [details] hopefully the last version > + * Copyright (c) 2009, Google Inc. All rights reserved. Please fix the copyright line, as discussed on IRC. > // FIXME: Rudely killing the thread won't work when we allow nested workers, because they will try to post notifications of their destruction. > - m_messageQueue.kill(); > + m_runLoop.terminate(); Do you happen to have a plan concerning this FIXME? > +#include <WorkerRunloop.h> Lower case "l" here, won't build on case-sensitive file systems. r=me with these fixes.
Dmitry Titov
Comment 5 2009-01-23 01:14:05 PST
Created attachment 26962 [details] Final version Addressed review comments by ap: - changed Copyright headers - fixed capitalization of include file name - FIXME: will address the nested workers as a whole feature later, don't have a plan for that yet, so left the FIXME. Ready for landing.
Alexey Proskuryakov
Comment 6 2009-01-23 07:54:15 PST
Committed revision 40161.
Note You need to log in before you can comment on or make changes to this bug.