TutCondWakeAll wake all threads waiting for a condition variable
cond
condition variable whose waiting threads are to be awakened
TRUE
if threads were successfully awakened or if no threads were waiting on the specified condition variable, FALSE
otherwise.
If TutCondWakeAll fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TutCondWakeAll wakes all threads that were waiting on the specified condition variable. A wake operation on a condition variable that does not have any waiting threads is not remembered. The next thread that waits on the condition variable blocks until the condition variable is again awakened.
None
This example creates a condition variable and a mutex. It then wakes any threads waiting on the condition variable. Finally, it destroys both the condition variable and the mutex.
T_COND cond; T_MUTEX mutex; T_BOOL status; cond = TutCondCreate(); if (T_INVALID_COND == cond) {/* error */
} mutex = TutMutexCreate(FALSE); if (T_INVALID_MUTEX == mutex) {/* error */
}/* lock the mutex */
if (!TutMutexLock(mutex, T_TIMEOUT_FOREVER)) {/* error */
} .../* unlock the mutex */
if (!TutMutexUnlock(mutex)) {/* error */
}/* wake threads waiting for the condition */
if (!TutCondWakeAll(cond)) {/* error */
} if (!TutCondDestroy(cond)) {/* error */
} if (!TutMutexDestroy(mutex)) {/* error */
}
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |