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