12 #ifndef __UT_Condition_h__
13 #define __UT_Condition_h__
35 void waitForTrigger(
UT_Lock &lock);
39 bool waitForTriggerMS(
UT_Lock &lock,
int64 timeout_msec);
60 #if defined(USE_PTHREADS)
61 pthread_cond_t myCond;
65 #error Missing implementation
79 UT_VERIFY(pthread_cond_init(&myCond, 0) == 0);
90 UT_VERIFY(pthread_cond_destroy(&myCond) == 0);
97 UT_VERIFY(pthread_cond_wait(&myCond, &lock.myLock) == 0);
104 UT_VERIFY(pthread_cond_broadcast(&myCond) == 0);
111 UT_VERIFY(pthread_cond_signal(&myCond) == 0);
114 #endif // USE_PTHREADS
125 struct _RTL_CONDITION_VARIABLE;
126 using CONDITION_VARIABLE = _RTL_CONDITION_VARIABLE;
128 __declspec(dllimport)
void __stdcall
129 WakeConditionVariable(CONDITION_VARIABLE *ConditionVariable);
130 __declspec(dllimport)
void __stdcall
131 WakeAllConditionVariable(CONDITION_VARIABLE *ConditionVariable);
159 return lock.sleepMS(
this, timeout_ms);
166 WakeAllConditionVariable((CONDITION_VARIABLE*) &myCond);
173 WakeConditionVariable((CONDITION_VARIABLE*) &myCond);
178 #endif // __UT_Condition_h__
bool waitForTriggerMS(UT_Lock &lock, int64 timeout_msec)
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
Condition synchronization primitive.
void waitForTrigger(UT_Lock &lock)
LeafData & operator=(const LeafData &)=delete