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

#include "checking_thread_system.h"

Inheritance diagram for net_instaweb::CheckingThreadSystem:
net_instaweb::ThreadSystem

Classes

class  Mutex
 
class  RWLock
 

Public Member Functions

 CheckingThreadSystem (ThreadSystem *thread_system)
 
virtual MutexNewMutex ()
 
virtual RWLockNewRWLock ()
 
virtual TimerNewTimer ()
 
virtual ThreadIdGetThreadId () const
 

Friends

class Mutex
 

Additional Inherited Members

- Public Types inherited from net_instaweb::ThreadSystem
enum  ThreadFlags { kDetached = 0, kJoinable = 1 }
 

Detailed Description

A thread system whose mutex and condvar factories yield implementations that permit checking of lock invariants using DCheckLocked(). This can be wrapped around an unchecked implementation. This implementation checks invariants using CHECK (so does checking unconditionally). To check conditionally, do the wrapping depending upon the setting of NDEBUG. This is done by the Platform::CreateThreadSystem() factory by default, which is why the invariant checking method is called DCheckLock (Debug check lock) and not CheckLock.

Member Function Documentation

virtual ThreadId* net_instaweb::CheckingThreadSystem::GetThreadId ( ) const
inlinevirtual

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

Implements net_instaweb::ThreadSystem.

virtual Mutex* net_instaweb::CheckingThreadSystem::NewMutex ( )
virtual

Makes a new mutex for this system.

See also CondvarCapableMutex::NewCondvar.

Implements net_instaweb::ThreadSystem.

virtual RWLock* net_instaweb::CheckingThreadSystem::NewRWLock ( )
virtual

This lock will provide following guarantee -

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

Implements net_instaweb::ThreadSystem.

virtual Timer* net_instaweb::CheckingThreadSystem::NewTimer ( )
virtual

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

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

Implements net_instaweb::ThreadSystem.


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