Panda3D
conditionVarPosixImpl.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 conditionVarPosixImpl.h
10  * @author drose
11  * @date 2006-02-10
12  */
13 
14 #ifndef CONDITIONVARPOSIXIMPL_H
15 #define CONDITIONVARPOSIXIMPL_H
16 
17 #include "pandabase.h"
18 #include "selectThreadImpl.h"
19 
20 #ifdef HAVE_POSIX_THREADS
21 
22 #include "mutexPosixImpl.h"
23 #include "pnotify.h"
24 #include "config_pipeline.h"
25 
26 #include <pthread.h>
27 
28 class MutexPosixImpl;
29 
30 /**
31  * Uses Posix threads to implement a conditionVar.
32  */
33 class EXPCL_PANDA_PIPELINE ConditionVarPosixImpl {
34 public:
35  INLINE ConditionVarPosixImpl(MutexPosixImpl &mutex);
36  INLINE ~ConditionVarPosixImpl();
37 
38  INLINE void wait();
39  void wait(double timeout);
40  INLINE void notify();
41  INLINE void notify_all();
42 
43 private:
44  MutexPosixImpl &_mutex;
45  pthread_cond_t _cvar;
46 };
47 
48 #include "conditionVarPosixImpl.I"
49 
50 #endif // HAVE_POSIX_THREADS
51 
52 #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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.