14#ifndef LIGHTMUTEXDIRECT_H
15#define LIGHTMUTEXDIRECT_H
31class EXPCL_PANDA_PIPELINE LightMutexDirect {
33 LightMutexDirect() =
default;
34 LightMutexDirect(
const LightMutexDirect ©) =
delete;
35 ~LightMutexDirect() =
default;
37 void operator = (
const LightMutexDirect ©) =
delete;
45 BLOCKING INLINE
void acquire()
const;
49 INLINE
void set_name(
const std::string &name);
54 void output(std::ostream &out)
const;
62 mutable MutexTrueImpl _impl;
64 mutable MutexImpl _impl;
This class implements a lightweight Mutex by making direct calls to the underlying implementation lay...
bool has_name() const
The lightMutex name is only defined when compiling in DEBUG_THREADS mode.
bool debug_is_locked() const
Returns true if the current thread has locked the LightMutex, false otherwise.
void clear_name()
The lightMutex name is only defined when compiling in DEBUG_THREADS mode.
void unlock()
Alias for release() to match C++11 semantics.
void lock()
Alias for acquire() to match C++11 semantics.
void set_name(const std::string &name)
The lightMutex name is only defined when compiling in DEBUG_THREADS mode.
void release() const
Releases the lightMutex.
void output(std::ostream &out) const
This method is declared virtual in LightMutexDebug, but non-virtual in LightMutexDirect.
std::string get_name() const
The lightMutex name is only defined when compiling in DEBUG_THREADS mode.
void acquire() const
Grabs the lightMutex if it is available.
bool try_lock()
Alias for try_acquire() to match C++11 semantics.
A thread; that is, a lightweight process.
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.