This class will also keep a heap of TimerBase objects that are scheduled to fire on a Worker's thread.
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.
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
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.
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.
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.
Committed revision 40161.