Page Speed Optimization Libraries  1.4.26.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::QueuedWorker Class Reference

See file comment. More...

#include "queued_worker.h"

Inheritance diagram for net_instaweb::QueuedWorker:
net_instaweb::Worker

List of all members.

Public Member Functions

 QueuedWorker (StringPiece thread_name, ThreadSystem *runtime)
virtual ~QueuedWorker ()
 This waits for the running task to terminate.
void RunInWorkThread (Function *closure)
void TimedWait (ThreadSystem::Condvar *condvar, int64 timeout_ms)

Detailed Description

See file comment.


Constructor & Destructor Documentation

net_instaweb::QueuedWorker::QueuedWorker ( 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).


Member Function Documentation

Runs the given closure in the work thread. Not that it's possible for the closure to be deleted without running in case where the system is shutting down.

Takes ownership of the closure.

void net_instaweb::QueuedWorker::TimedWait ( ThreadSystem::Condvar condvar,
int64  timeout_ms 
)

Issue a TimedWait on the specified condition variable. In a mock-time world, this queues a time-advancement closure on the worker, and then blocks waiting for the work-queue to be drained.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines