Panda3D
panda
src
pipeline
mutexDirect.h
Go to the documentation of this file.
1
/**
2
* PANDA 3D SOFTWARE
3
* Copyright (c) Carnegie Mellon University. All rights reserved.
4
*
5
* All use of this software is subject to the terms of the revised BSD
6
* license. You should have received a copy of this license along
7
* with this source code in a file named "LICENSE."
8
*
9
* @file mutexDirect.h
10
* @author drose
11
* @date 2006-02-13
12
*/
13
14
#ifndef MUTEXDIRECT_H
15
#define MUTEXDIRECT_H
16
17
#include "
pandabase.h
"
18
#include "
mutexTrueImpl.h
"
19
#include "
pnotify.h
"
20
21
class
Thread
;
22
23
#ifndef DEBUG_THREADS
24
25
/**
26
* This class implements a standard mutex by making direct calls to the
27
* underlying implementation layer. It doesn't perform any debugging
28
* operations.
29
*/
30
class
EXPCL_PANDA_PIPELINE
MutexDirect
{
31
protected
:
32
MutexDirect
() =
default
;
33
MutexDirect
(
const
MutexDirect
©) =
delete
;
34
~
MutexDirect
() =
default
;
35
36
void
operator = (
const
MutexDirect
©) =
delete
;
37
38
public
:
39
INLINE
void
lock();
40
INLINE
bool
try_lock();
41
INLINE
void
unlock();
42
43
PUBLISHED:
44
BLOCKING INLINE
void
acquire()
const
;
45
BLOCKING INLINE
bool
try_acquire()
const
;
46
INLINE
void
release()
const
;
47
INLINE
bool
debug_is_locked()
const
;
48
49
INLINE
void
set_name(
const
std::string &name);
50
INLINE
void
clear_name();
51
INLINE
bool
has_name()
const
;
52
INLINE std::string get_name()
const
;
53
54
void
output(std::ostream &out)
const
;
55
56
private
:
57
mutable
MutexTrueImpl
_impl;
58
59
friend
class
ConditionVarDirect
;
60
friend
class
ConditionVarFullDirect
;
61
};
62
63
INLINE std::ostream &
64
operator << (std::ostream &out,
const
MutexDirect
&m) {
65
m.
output
(out);
66
return
out;
67
}
68
69
#include "
mutexDirect.I
"
70
71
#endif // !DEBUG_THREADS
72
73
#endif
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pnotify.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
mutexDirect.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
mutexTrueImpl.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
MutexDirect::output
void output(std::ostream &out) const
This method is declared virtual in MutexDebug, but non-virtual in MutexDirect.
Definition:
mutexDirect.cxx:23
ConditionVarFullDirect
A condition variable, usually used to communicate information about changing state to a thread that i...
Definition:
conditionVarFullDirect.h:32
Thread
A thread; that is, a lightweight process.
Definition:
thread.h:46
MutexDummyImpl
A fake mutex implementation for single-threaded applications that don't need any synchronization cont...
Definition:
mutexDummyImpl.h:24
ConditionVarDirect
A condition variable, usually used to communicate information about changing state to a thread that i...
Definition:
conditionVarDirect.h:32
MutexDirect
This class implements a standard mutex by making direct calls to the underlying implementation layer.
Definition:
mutexDirect.h:30
Generated on Wed Jan 23 2019 21:40:14 for Panda3D by
1.8.15