Panda3D
blockerSimple.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 blockerSimple.h
10  * @author drose
11  * @date 2007-06-20
12  */
13 
14 #ifndef BLOCKERSIMPLE_H
15 #define BLOCKERSIMPLE_H
16 
17 #include "pandabase.h"
18 #include "selectThreadImpl.h"
19 
20 #ifdef THREAD_SIMPLE_IMPL
21 
22 #include "pnotify.h"
23 
24 /**
25  * This is a base class for MutexSimpleImpl and ConditionVarSimpleImpl. It
26  * represents a synchronization primitive that one or more threads might be
27  * blocked on.
28  */
29 class EXPCL_PANDA_PIPELINE BlockerSimple {
30 protected:
31  constexpr BlockerSimple() = default;
32  INLINE ~BlockerSimple();
33 
34 protected:
35  enum Flags {
36  // lock_count is only used for mutexes, not condition variables.
37  F_lock_count = 0x3fffffff,
38  F_has_waiters = 0x40000000,
39  };
40 
41  unsigned int _flags = 0;
42 
43  friend class ThreadSimpleManager;
44 };
45 
46 #include "blockerSimple.I"
47 
48 #endif // THREAD_SIMPLE_IMPL
49 
50 #endif
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.