25 out <<
"ReMutex " << (
void *)
this;
28 #ifndef HAVE_REMUTEXTRUEIMPL 36 do_lock(
Thread *current_thread) {
39 if (_locking_thread ==
nullptr) {
41 _locking_thread = current_thread;
43 nassertd(_lock_count == 1) {
46 }
else if (_locking_thread == current_thread) {
49 nassertd(_lock_count > 0) {
55 while (_locking_thread !=
nullptr) {
59 _locking_thread = current_thread;
61 nassertd(_lock_count == 1) {
66 #endif // !HAVE_REMUTEXTRUEIMPL 68 #ifndef HAVE_REMUTEXTRUEIMPL 76 do_try_lock(
Thread *current_thread) {
80 if (_locking_thread ==
nullptr) {
82 _locking_thread = current_thread;
84 nassertd(_lock_count == 1) {
87 }
else if (_locking_thread == current_thread) {
90 nassertd(_lock_count > 0) {
101 #endif // !HAVE_REMUTEXTRUEIMPL 103 #ifndef HAVE_REMUTEXTRUEIMPL 115 nassertd(_locking_thread == Thread::get_current_thread()) {
119 #elif !defined(NDEBUG) 120 nassertd(_locking_thread !=
nullptr) {
129 nassertd(_lock_count > 0) {
134 #endif // !HAVE_REMUTEXTRUEIMPL 136 #ifndef HAVE_REMUTEXTRUEIMPL 144 do_unlock(
Thread *current_thread) {
148 if (_locking_thread != current_thread) {
149 std::ostringstream ostr;
150 ostr << *_locking_thread <<
" attempted to release " 151 << *
this <<
" which it does not own";
152 nassert_raise(ostr.str());
158 nassertd(_lock_count > 0) {
162 if (_lock_count == 0) {
164 _locking_thread =
nullptr;
169 #endif // !HAVE_REMUTEXTRUEIMPL 171 #endif // !DEBUG_THREADS PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A thread; that is, a lightweight process.
void output(std::ostream &out) const
This method is declared virtual in MutexDebug, but non-virtual in ReMutexDirect.