Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
net_instaweb::ThreadSystem Class Referenceabstract

#include "thread_system.h"

Inheritance diagram for net_instaweb::ThreadSystem:
net_instaweb::CheckingThreadSystem net_instaweb::NullThreadSystem net_instaweb::PthreadThreadSystem net_instaweb::SystemThreadSystem net_instaweb::ApacheThreadSystem

Classes

class  Condvar
 
class  CondvarCapableMutex
 
class  RWLock
 
class  ScopedReader
 
class  Thread
 Base class for client thread code. More...
 
class  ThreadId
 
class  ThreadImpl
 

Public Types

enum  ThreadFlags { kDetached = 0, kJoinable = 1 }
 

Public Member Functions

virtual CondvarCapableMutexNewMutex ()=0
 
virtual RWLockNewRWLock ()=0
 
virtual TimerNewTimer ()=0
 
virtual ThreadIdGetThreadId () const =0
 

Friends

class Thread
 
class MockThreadSystem
 
class CheckingThreadSystem
 

Detailed Description

Subclasses of this represent threading support under given environment, and help create various primitives for it.

Member Function Documentation

virtual ThreadId* net_instaweb::ThreadSystem::GetThreadId ( ) const
pure virtual

Returns an object holding the current thread ID. The resultant object must be freed by the caller.

Implemented in net_instaweb::CheckingThreadSystem, net_instaweb::NullThreadSystem, and net_instaweb::PthreadThreadSystem.

virtual CondvarCapableMutex* net_instaweb::ThreadSystem::NewMutex ( )
pure virtual
virtual RWLock* net_instaweb::ThreadSystem::NewRWLock ( )
pure virtual

This lock will provide following guarantee -

  • Reader reentrant safe.
  • Writer Priority, this ensures no writer starvation.

Implemented in net_instaweb::CheckingThreadSystem, net_instaweb::NullThreadSystem, and net_instaweb::PthreadThreadSystem.

virtual Timer* net_instaweb::ThreadSystem::NewTimer ( )
pure virtual

Creates and returns a real-time timer. Caller is responsible for deleting.

Todo:
TODO(jmarantz): consider removing this and controlling timers separately.

Implemented in net_instaweb::CheckingThreadSystem, net_instaweb::NullThreadSystem, net_instaweb::PthreadThreadSystem, and net_instaweb::ApacheThreadSystem.


The documentation for this class was generated from the following file: