OpenTTD
|
Cross-platform Mutex. More...
#include <thread.h>
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 ThreadMutex * | New () |
Create a new mutex. | |
|
pure virtual |
Begin the critical section.
allow_recursive | Whether recursive locking is intentional. If false, NOT_REACHED() will be called when the mutex is already locked by the current thread. |
Implemented in ThreadMutex_pthread, ThreadMutex_Win32, ThreadMutex_OS2, and ThreadMutex_None.
Referenced by VideoDriver_SDL::AcquireBlitterLock(), VideoDriver_Win32::AcquireBlitterLock(), GRFFileScanner::AddFile(), VideoDriver_SDL::ChangeResolution(), VideoDriver_Win32::ChangeResolution(), PacketWriter::Destroy(), DoScanNewGRFFiles(), VideoDriver_Win32::EditBoxLostFocus(), PacketWriter::Finish(), NetworkBackgroundUDPLoop(), NetworkGameListAddItemDelayed(), NetworkGameListHandleDelayedInsert(), NetworkUDPAdvertiseThread(), NetworkUDPClose(), NetworkUDPQueryServer(), NetworkUDPRemoveAdvertiseThread(), PacketWriter::PopPacket(), ScanNewGRFFiles(), ThreadMutexLocker::ThreadMutexLocker(), VideoDriver_Win32::ToggleFullscreen(), WaitTillGeneratedWorld(), PacketWriter::Write(), and PacketWriter::~PacketWriter().
|
pure virtual |
End of the critical section.
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. |
Implemented in ThreadMutex_pthread, ThreadMutex_Win32, ThreadMutex_OS2, and ThreadMutex_None.
Referenced by GRFFileScanner::AddFile(), VideoDriver_SDL::ChangeResolution(), PacketWriter::Destroy(), DoScanNewGRFFiles(), PacketWriter::Finish(), NetworkBackgroundUDPLoop(), NetworkGameListAddItemDelayed(), NetworkUDPAdvertiseThread(), NetworkUDPClose(), NetworkUDPQueryServer(), NetworkUDPRemoveAdvertiseThread(), PacketWriter::PopPacket(), VideoDriver_Win32::ReleaseBlitterLock(), VideoDriver_SDL::ReleaseBlitterLock(), ScanNewGRFFiles(), VideoDriver_Win32::ToggleFullscreen(), WaitTillGeneratedWorld(), PacketWriter::Write(), and PacketWriter::~PacketWriter().
|
pure virtual |
Wait for a signal to be send.
Implemented in ThreadMutex_pthread, ThreadMutex_Win32, ThreadMutex_OS2, and ThreadMutex_None.
Referenced by PacketWriter::~PacketWriter().