net_instaweb::ThreadSystem::Thread Class Reference

Base class for client thread code. More...

#include "thread.h"

Inheritance diagram for net_instaweb::ThreadSystem::Thread:
net_instaweb::SchedulerThread

List of all members.

Public Member Functions

 Thread (ThreadSystem *runtime, ThreadFlags flags)
virtual ~Thread ()
bool Start ()
void Join ()
virtual void Run ()=0

Detailed Description

Base class for client thread code.


Constructor & Destructor Documentation

net_instaweb::ThreadSystem::Thread::Thread ( ThreadSystem runtime,
ThreadFlags  flags 
)

Initializes the thread object for given runtime, but does not start it. (You need to call Start() for that)

If you pass in kJoinable for flags, you must explicitly call Join() to wait for thread to complete and release associated resources. That is not needed with kDetach, but you are still responsible for cleaning up the Thread object.

Any mutexes and condvars you use must be compatible with the passed in 'runtime'.

virtual net_instaweb::ThreadSystem::Thread::~Thread (  )  [virtual]

Note: it is safe to delete the Thread object from within Run as far as this baseclass is concerned.


Member Function Documentation

void net_instaweb::ThreadSystem::Thread::Join (  ) 

Waits for the thread executing Run() to exit. This must be called on every thread created with kJoinable.

bool net_instaweb::ThreadSystem::Thread::Start (  ) 

Invokes Run() in a separate thread. Returns if successful or not. ### MessageHandler?


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:34:21 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3