18 : mManualReset(manualReset)
21 pthread_mutex_init(&mMutex,
NULL);
22 pthread_cond_init(&mCondVar,
NULL);
29 pthread_cond_destroy(&mCondVar);
30 pthread_mutex_destroy(&mMutex);
40 pthread_mutex_lock(&mMutex);
42 theError = pthread_cond_broadcast(&mCondVar);
43 pthread_mutex_unlock(&mMutex);
94 mManualReset = manualReset;
104 *pManualReset = mManualReset;
115 static const long long NS_PER_SEC = 1000000000ULL;
118 int64_t nanos = timeout;
128 ts.tv_sec += (nanos / NS_PER_SEC);
129 ts.tv_nsec = (nanos % NS_PER_SEC);
131 pthread_mutex_lock(&mMutex);
133 if (
false == mSignaled)
135 result = pthread_cond_timedwait(&mCondVar, &mMutex, &ts);
139 if (result == ETIMEDOUT)
142 "AJAEventImpl::WaitForSignal() timeout", result);
148 "AJAEventImpl::WaitForSignal() "
149 "pthread_cond_timedwait returns error %08x", result);
158 pthread_mutex_unlock(&mMutex);