LibHTTP API Reference

December 19, 2016 ยท View on GitHub

httplib_pthread_mutex_lock( mutex );

Parameters

ParameterTypeDescription
mutexpthread_mutex_tThe key to the mutex to lock

Return Value

TypeDescription
intInteger value with the result of the function call

Description

The platform independent function httplib_pthread_mutex_lock() is used to lock a mutex. The function returns 0 if this is succesful, or an error code if it fails. If a mutex is locked by another thread, the function will not return but wait until the other thread releases the mutex and the mutex be successfully locked. On systems which support it, this function is implemented as a direct call to pthread_mutex_lock(). On other systems own code is used to emulate the same functionality.

See Also