33 #ifndef vtkConditionVariable_h
34 #define vtkConditionVariable_h
36 #include "vtkCommonCoreModule.h"
39 #include "vtkThreads.h"
43 #if defined(VTK_USE_PTHREADS)
50 #ifdef VTK_USE_WIN32_THREADS
52 #define _WIN32_WINNT 0x0501 // 0x0501 means target Windows XP or later
54 #include "vtkWindows.h"
57 #ifdef VTK_USE_WIN32_THREADS
59 struct pthread_cond_t_t
62 int WaitingThreadCount;
65 CRITICAL_SECTION WaitingThreadCountCritSec;
68 vtkWindowsHANDLE Semaphore;
72 vtkWindowsHANDLE DoneWaiting;
77 using pthread_cond_t =
struct pthread_cond_t_t;
81 struct pthread_cond_t_t
84 int WaitingThreadCount;
87 CRITICAL_SECTION WaitingThreadCountCritSec;
98 vtkWindowsHANDLE Event;
100 using pthread_cond_t =
struct pthread_cond_t_t;
104 #endif // VTK_USE_WIN32_THREADS
106 #ifndef VTK_USE_PTHREADS
107 #ifndef VTK_USE_WIN32_THREADS
117 vtkSimpleConditionVariable();
118 ~vtkSimpleConditionVariable();
120 static vtkSimpleConditionVariable* New();
151 vtkSimpleConditionVariable(
const vtkSimpleConditionVariable& other) =
delete;
152 vtkSimpleConditionVariable& operator=(
const vtkSimpleConditionVariable& rhs) =
delete;
161 void PrintSelf(ostream& os,
vtkIndent indent)
override;
211 #endif // vtkConditionVariable_h
void Signal()
Wake one thread waiting for the condition to change.
#define VTK_DEPRECATED_IN_9_1_0(reason)
mutual exclusion locking class
abstract base class for most VTK objects
int Wait(vtkSimpleMutexLock &mutex)
Wait for the condition to change.
void Broadcast()
Wake all threads waiting for the condition to change.
void Signal()
Wake one thread waiting for the condition to change.
a simple class to control print indentation
void Broadcast()
Wake all threads waiting for the condition to change.
int Wait(vtkMutexLock *mutex)
Wait for the condition to change.
vtkSimpleMutexLock SimpleMutexLock
vtkConditionType ConditionVariable
vtkSimpleConditionVariable SimpleConditionVariable
mutual exclusion locking class