LibHTTP API Reference

December 19, 2016 ยท View on GitHub

httplib_pthread_mutex_init( mutex, attr );

Parameters

ParameterTypeDescription
mutexpthread_mutex_tThe key to the mutex to initialize
attrconst pthread_mutexattr_tOptional attributes for the initialization

Return Value

TypeDescription
intInteger value with the result of the function

Description

The platform independent function httplib_pthread_mutex_init() is used to initialize a mutex. The function returns 0 if this is successful, or an error code if it fails. On systems which support it, this function is implemented as a direct call to pthread_mutex_init(). On other systems own code is used to emulate the same functionality.

Please not that on systems which do not support pthread_mutex_init() natively that the attr parameter is ignored.

See Also