14#ifndef REMUTEXDIRECT_H
15#define REMUTEXDIRECT_H
29class EXPCL_PANDA_PIPELINE ReMutexDirect {
31 INLINE ReMutexDirect();
32 ReMutexDirect(
const ReMutexDirect ©) =
delete;
33 ~ReMutexDirect() =
default;
35 void operator = (
const ReMutexDirect ©) =
delete;
43 BLOCKING INLINE
void acquire()
const;
52 INLINE
void set_name(
const std::string &name);
57 void output(std::ostream &out)
const;
60#ifdef HAVE_REMUTEXTRUEIMPL
61 mutable ReMutexTrueImpl _impl;
65 INLINE
void do_lock();
66 void do_lock(
Thread *current_thread);
67 INLINE
bool do_try_lock();
68 bool do_try_lock(
Thread *current_thread);
69 void do_elevate_lock();
75 MutexTrueImpl _lock_impl;
76 ConditionVarImpl _cvar_impl;
79 friend class LightReMutexDirect;
This class implements a standard reMutex by making direct calls to the underlying implementation laye...
std::string get_name() const
The mutex name is only defined when compiling in DEBUG_THREADS mode.
void output(std::ostream &out) const
This method is declared virtual in MutexDebug, but non-virtual in ReMutexDirect.
bool try_lock()
Alias for try_acquire() to match C++11 semantics.
void acquire() const
Grabs the reMutex if it is available.
bool debug_is_locked() const
Returns true if the current thread has locked the ReMutex, false otherwise.
void unlock()
Alias for release() to match C++11 semantics.
bool has_name() const
The mutex name is only defined when compiling in DEBUG_THREADS mode.
void clear_name()
The mutex name is only defined when compiling in DEBUG_THREADS mode.
void elevate_lock() const
This method increments the lock count, assuming the calling thread already holds the lock.
void release() const
Releases the reMutex.
void lock()
Alias for acquire() to match C++11 semantics.
bool try_acquire() const
Returns immediately, with a true value indicating the mutex has been acquired, and false indicating i...
void set_name(const std::string &name)
The mutex name is only defined when compiling in DEBUG_THREADS mode.
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.