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

#include "null_thread_system.h"

Inheritance diagram for net_instaweb::NullThreadSystem:
net_instaweb::ThreadSystem

Public Member Functions

virtual NullCondvarCapableMutexNewMutex ()
 
virtual RWLockNewRWLock ()
 
virtual TimerNewTimer ()
 
virtual ThreadIdGetThreadId () const
 
void set_current_thread (int id)
 Provide injection/observation of current thread IDs.
 
int current_thread () const
 

Additional Inherited Members

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

Detailed Description

Mock thread system. This can create mutexes that do no locking, condvars that do no waiting, and can't create threads. Trying to create a thread will result in a fatal error.

Member Function Documentation

virtual ThreadId* net_instaweb::NullThreadSystem::GetThreadId ( ) const
virtual

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

Implements net_instaweb::ThreadSystem.

virtual NullCondvarCapableMutex* net_instaweb::NullThreadSystem::NewMutex ( )
virtual

Makes a new mutex for this system.

See also CondvarCapableMutex::NewCondvar.

Implements net_instaweb::ThreadSystem.

virtual RWLock* net_instaweb::NullThreadSystem::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::NullThreadSystem::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: