Panda3D
 All Classes Functions Variables Enumerations
conditionVarSimpleImpl.I
1 // Filename: conditionVarSimpleImpl.I
2 // Created by: drose (19Jun07)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: ConditionVarSimpleImpl::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE ConditionVarSimpleImpl::
22 ConditionVarSimpleImpl(MutexTrueImpl &mutex) : _mutex(mutex) {
23 }
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: ConditionVarSimpleImpl::Destructor
27 // Access: Public
28 // Description:
29 ////////////////////////////////////////////////////////////////////
30 INLINE ConditionVarSimpleImpl::
31 ~ConditionVarSimpleImpl() {
32 }
33 
34 ////////////////////////////////////////////////////////////////////
35 // Function: ConditionVarSimpleImpl::notify
36 // Access: Public
37 // Description:
38 ////////////////////////////////////////////////////////////////////
39 INLINE void ConditionVarSimpleImpl::
40 notify() {
41  if (_flags & F_has_waiters) {
42  do_notify();
43  }
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: ConditionVarSimpleImpl::notify_all
48 // Access: Public
49 // Description:
50 ////////////////////////////////////////////////////////////////////
51 INLINE void ConditionVarSimpleImpl::
52 notify_all() {
53  if (_flags & F_has_waiters) {
54  do_notify_all();
55  }
56 }
A fake mutex implementation for single-threaded applications that don't need any synchronization cont...