Page Speed Optimization Libraries
1.5.27.2
|
See file comment. More...
#include "slow_worker.h"
Public Member Functions | |
SlowWorker (StringPiece thread_name, ThreadSystem *runtime) | |
virtual | ~SlowWorker () |
This waits for the running task to terminate. | |
void | RunIfNotBusy (Function *closure) |
See file comment.
net_instaweb::SlowWorker::SlowWorker | ( | StringPiece | thread_name, |
ThreadSystem * | runtime | ||
) |
Initializes the worker. You still need to call ->Start to actually start the thread, however. (Note: start can return false on failure).
void net_instaweb::SlowWorker::RunIfNotBusy | ( | Function * | closure | ) |
If this SlowWorker's thread is currently idle, it will run the closure. Otherwise, the closure will simply be deleted.
Takes ownership of the closure.