Panda3D
|
00001 // Filename: blockerSimple.h 00002 // Created by: drose (20Jun07) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef BLOCKERSIMPLE_H 00016 #define BLOCKERSIMPLE_H 00017 00018 #include "pandabase.h" 00019 #include "selectThreadImpl.h" 00020 00021 #ifdef THREAD_SIMPLE_IMPL 00022 00023 #include "pnotify.h" 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : BlockerSimple 00027 // Description : This is a base class for MutexSimpleImpl and 00028 // ConditionVarSimpleImpl. It represents a 00029 // synchronization primitive that one or more threads 00030 // might be blocked on. 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDA_PIPELINE BlockerSimple { 00033 protected: 00034 INLINE BlockerSimple(); 00035 INLINE ~BlockerSimple(); 00036 00037 protected: 00038 enum Flags { 00039 // lock_count is only used for mutexes, not condition variables. 00040 F_lock_count = 0x3fffffff, 00041 F_has_waiters = 0x40000000, 00042 }; 00043 00044 unsigned int _flags; 00045 00046 friend class ThreadSimpleManager; 00047 }; 00048 00049 #include "blockerSimple.I" 00050 00051 #endif // THREAD_SIMPLE_IMPL 00052 00053 #endif