Page Speed Optimization Libraries  1.5.27.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Friends
net_instaweb::ThreadSystem Class Reference

#include "thread_system.h"

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

List of all members.

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 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::ApacheThreadSystem, and net_instaweb::PthreadThreadSystem.


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