Panda3D

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ReMutex Class Reference

A reentrant mutex. More...

`#include "reMutex.h"`

Inheritance diagram for ReMutex:

## Public Member Functions
| ReMutex (const char *name)
| ReMutex (const ReMutex &copy)=delete
| ReMutex (const std::string &name)
void | operator= (const ReMutex &copy)=delete
Public Member Functions inherited from ReMutexDirect
void | acquire () const
| Grabs the reMutex if it is available.
void | acquire (Thread *current_thread) const
| This variant on acquire() accepts the current thread as a parameter, if it is already known, as an optimization.
void | clear_name ()
| The mutex name is only defined when compiling in DEBUG_THREADS mode.
bool | debug_is_locked () const
| Returns true if the current thread has locked the ReMutex, false otherwise.
void | elevate_lock () const
| This method increments the lock count, assuming the calling thread already holds the lock.
std::string | get_name () const
| The mutex name is only defined when compiling in DEBUG_THREADS mode.
bool | has_name () const
| The mutex name is only defined when compiling in DEBUG_THREADS mode.
void | lock ()
| Alias for acquire() to match C++11 semantics.
void | output (std::ostream &out) const
| This method is declared virtual in MutexDebug, but non-virtual in ReMutexDirect.
void | release () const
| Releases the reMutex.
void | set_name (const std::string &name)
| The mutex name is only defined when compiling in DEBUG_THREADS mode.
bool | try_acquire () const
| Returns immediately, with a true value indicating the mutex has been acquired, and false indicating it has not.
bool | try_acquire (Thread *current_thread) const
| Returns immediately, with a true value indicating the mutex has been acquired, and false indicating it has not.
bool | try_lock ()
| Alias for try_acquire() to match C++11 semantics.
void | unlock ()
| Alias for release() to match C++11 semantics.

## Detailed Description

A reentrant mutex.

This kind of mutex can be locked more than once by the thread that already holds it, without deadlock. The thread must eventually release the mutex the same number of times it locked it.

This class inherits its implementation either from MutexDebug or ReMutexDirect, depending on the definition of DEBUG_THREADS.

Definition at line 32 of file reMutex.h.

## Constructor & Destructor Documentation

## ◆ ReMutex() [1/3]

ReMutex::ReMutex | ( |  | ) |
| inline

Definition at line 17 of file reMutex.I.

## ◆ ReMutex() [2/3]

ReMutex::ReMutex | ( | const char * | name | ) |
| inline explicit

Definition at line 29 of file reMutex.I.

## ◆ ReMutex() [3/3]

ReMutex::ReMutex | ( | const std::string & | name | ) |
| inline explicit

Definition at line 41 of file reMutex.I.

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

- panda/src/pipeline/reMutex.h
- panda/src/pipeline/reMutex.I