18 : mManualReset(manualReset)
22 pthread_mutex_init(&mMutex,
NULL);
23 pthread_cond_init(&mCondVar,
NULL);
32 pthread_cond_destroy(&mCondVar);
33 pthread_mutex_destroy(&mMutex);
45 pthread_mutex_lock(&mMutex);
47 theError = pthread_cond_broadcast(&mCondVar);
48 pthread_mutex_unlock(&mMutex);
102 mManualReset = manualReset;
112 *pManualReset = mManualReset;
124 static const long long NS_PER_SEC = 1000000000ULL;
127 int64_t nanos = timeout;
137 ts.tv_sec += (nanos / NS_PER_SEC);
138 ts.tv_nsec = (nanos % NS_PER_SEC);
140 pthread_mutex_lock(&mMutex);
142 if (
false == mSignaled)
144 result = pthread_cond_timedwait(&mCondVar, &mMutex, &ts);
148 if (result == ETIMEDOUT)
151 "AJAEventImpl::WaitForSignal() timeout", result);
157 "AJAEventImpl::WaitForSignal() "
158 "pthread_cond_timedwait returns error %08x", result);
167 pthread_mutex_unlock(&mMutex);