OpenTTD: ThreadMutex_None Class Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
ThreadMutex_None Class Reference

Mutex that doesn't do locking because it ain't needed when there're no threads. More...

Inheritance diagram for ThreadMutex_None:

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

## Additional Inherited Members
Static Public Member Functions inherited from ThreadMutex
static ThreadMutex * | New ()
| Create a new mutex.

## Detailed Description

Mutex that doesn't do locking because it ain't needed when there're no threads.

Definition at line 24 of file thread_none.cpp.

## Member Function Documentation

virtual void ThreadMutex_None::BeginCritical | ( | bool | allow_recursive = `false` | ) |
| inlinevirtual

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 26 of file thread_none.cpp.

virtual void ThreadMutex_None::EndCritical | ( | bool | allow_recursive = `false` | ) |
| inlinevirtual

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 27 of file thread_none.cpp.

virtual void ThreadMutex_None::WaitForSignal | ( |  | ) |
| inlinevirtual

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 28 of file thread_none.cpp.

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

- src/thread/thread_none.cpp