LibHTTP API Reference

December 19, 2016 ยท View on GitHub

httplib_pthread_cond_timedwait( cv, mutex, abstime );

Parameters

ParameterTypeDescription
cvpthread_cond_tThe condition to wait for
mutexpthread_mutex_t *The mutex to release when the condition is met
abstimeconst struct timespec *structure containing the desired timeout time

Return Value

TypeDescription
intInteger value with a success or error code of the function call

Description

The platform independent function httplib_pthread_cond_timedwait() is used to wait for a specific condition to be met. After the condition is met, the specified mutex is unlocked. If the function succeeds, the value 0 is returned, otherwise the return value is an error code. A timeout value is specified after which the function will return, even if the condition is not met. In the later case an error code indicating the timeout is returned. On systems which support it, the functionality is implemented as a direct call to pthread_cond_timedwait(). Otherwise an OS dependent alternative function is called.

See Also