OpenTTD
ThreadMutexLocker Class Reference

Simple mutex locker to keep a mutex locked until the locker goes out of scope. More...

#include <thread.h>

Public Member Functions

 ThreadMutexLocker (ThreadMutex *mutex)
 Lock the mutex and keep it locked for the life time of this object. More...
 
 ~ThreadMutexLocker ()
 Unlock the mutex.
 

Private Member Functions

 ThreadMutexLocker (const ThreadMutexLocker &)
 
ThreadMutexLocker & operator= (const ThreadMutexLocker &)
 

Private Attributes

ThreadMutex * mutex
 

Detailed Description

Simple mutex locker to keep a mutex locked until the locker goes out of scope.

Definition at line 101 of file thread.h.

Constructor & Destructor Documentation

◆ ThreadMutexLocker()

ThreadMutexLocker::ThreadMutexLocker ( ThreadMutex *  mutex)
inline

Lock the mutex and keep it locked for the life time of this object.

Parameters
mutexMutex to be locked.

Definition at line 107 of file thread.h.

References ThreadMutex::BeginCritical().


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