OpenTTD
Public Member Functions | Static Public Member Functions
ThreadMutex Class Referenceabstract

Cross-platform Mutex. More...

#include <thread.h>

Inheritance diagram for ThreadMutex:
ThreadMutex_None ThreadMutex_OS2 ThreadMutex_pthread ThreadMutex_Win32

Public Member Functions

virtual ~ThreadMutex ()
 Virtual Destructor to avoid compiler warnings.
 
virtual void BeginCritical (bool allow_recursive=false)=0
 Begin the critical section. More...
 
virtual void EndCritical (bool allow_recursive=false)=0
 End of the critical section. More...
 
virtual void WaitForSignal ()=0
 Wait for a signal to be send. More...
 
virtual void SendSignal ()=0
 Send a signal and wake the 'thread' that was waiting for it.
 

Static Public Member Functions

static ThreadMutexNew ()
 Create a new mutex.
 

Detailed Description

Cross-platform Mutex.

Definition at line 56 of file thread.h.

Member Function Documentation

◆ BeginCritical()

virtual void ThreadMutex::BeginCritical ( bool  allow_recursive = false)
pure virtual

◆ EndCritical()

virtual void ThreadMutex::EndCritical ( bool  allow_recursive = false)
pure virtual

◆ WaitForSignal()

virtual void ThreadMutex::WaitForSignal ( )
pure 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.

Implemented in ThreadMutex_pthread, ThreadMutex_Win32, ThreadMutex_OS2, and ThreadMutex_None.

Referenced by PacketWriter::~PacketWriter().


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