Public Member Functions | Private Attributes

ThreadMutex_pthread Class Reference

POSIX pthread version of ThreadMutex. More...

Inheritance diagram for ThreadMutex_pthread:
ThreadMutex

Public Member Functions

bool IsOwnedByCurrentThread () const
void BeginCritical (bool allow_recursive=false)
 Begin the critical section.
void EndCritical (bool allow_recursive=false)
 End of the critical section.
void WaitForSignal ()
 Wait for a signal to be send.
void SendSignal ()
 Send a signal and wake the 'thread' that was waiting for it.

Private Attributes

pthread_mutex_t mutex
 The actual mutex.
pthread_cond_t condition
 Data for conditional waiting.
pthread_mutexattr_t attr
 Attributes set for the mutex.
pthread_t owner
 Owning thread of the mutex.
uint recursive_count
 Recursive lock count.

Detailed Description

POSIX pthread version of ThreadMutex.

Definition at line 96 of file thread_pthread.cpp.


Member Function Documentation

void ThreadMutex_pthread::BeginCritical ( bool  allow_recursive = false  )  [inline, virtual]

Begin the critical section.

Parameters:
allow_recursive Whether recursive locking is intentional. If false, NOT_REACHED() will be called when the mutex is already locked by the current thread.

Implements ThreadMutex.

Definition at line 126 of file thread_pthread.cpp.

References mutex, owner, and recursive_count.

void ThreadMutex_pthread::EndCritical ( bool  allow_recursive = false  )  [inline, virtual]

End of the critical section.

Parameters:
allow_recursive Whether recursive unlocking is intentional. If false, NOT_REACHED() will be called when the mutex was locked more than once by the current thread.

Implements ThreadMutex.

Definition at line 140 of file thread_pthread.cpp.

References mutex, owner, and recursive_count.

void ThreadMutex_pthread::WaitForSignal (  )  [inline, virtual]

Wait for a signal to be send.

Precondition:
You must be in the critical section.
Note:
While waiting the critical section is left.
Postcondition:
You will be in the critical section.

Implements ThreadMutex.

Definition at line 151 of file thread_pthread.cpp.

References condition, mutex, owner, and recursive_count.


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