The pthread_mutex_trylock function

Name

pthread_mutex_trylock -- 

Synopsis

#include <pthread.h>

int pthread_mutex_trylock (pthread_mutex_t *mutex);

Description

The pthread_mutex_trylock function tries to lock the given mutex. If the mutex is already locked, the function returns without waiting for the mutex to be unlocked.

Returns

The pthread_mutex_trylock function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

None