TutMutexLock lock a mutex object
mutex
mutex object to lock
timeout
maximum number of seconds to wait for mutex
TRUE
if mutex object was successfully locked, FALSE
otherwise.
If TutMutexLock fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TutMutexLock attempts to lock a mutex object. If mutex
is not immediately available, the calling thread is suspended until the mutex becomes available or until the timeout
period specified has expired. The reserved timeout
value T_TIMEOUT_FOREVER may be used to specify an indefinite wait.
Every call to TutMutexLock should be balanced by a subsequent call to TutMutexUnlock.
TutMutexCreate, TutMutexUnlock
This example attempts to lock a mutex object with a one-second timeout:
T_MUTEX mutex; ... if (!TutMutexLock(mutex, 1.0)) { if (T_ERR_TIMEOUT_REACHED != TutErrNumGet()) {/* error */
}/* timeout */
... } ...
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |