<assertions> | |
<assertion id="1" tag="ref:XSH6:33930:33932"> | |
The function | |
int pthread_mutex_trylock(pthread_mutex_t *mutex); | |
is equivalent to pthread_mutex_lock() except that if the mutex object | |
referenced by 'mutex' is currently locked (by any thread, including the | |
current thread), the call returns immediately. | |
</assertion> | |
<assertion id="2" tag="ref:XSH6:33932:33934"> | |
If the mutex type is PTHREAD_MUTEX_RECURSIVE and the mutex is currently | |
owned by the calling thread, the mutex lock count shall be incremented | |
by one and the pthread_mutex_trylock() function immediately returns | |
success. | |
</assertion> | |
<assertion id="3" tag="ref:XSH6:33947:33948"> | |
It returns 0 if a lock on the mutex object referenced by 'mutex' is | |
acquired. | |
</assertion> | |
<assertion id="4" tag="ref:XSH6:33950:33965"> | |
Upon failure, it shall return: | |
-[EINVAL] The mutex was created with the protocol attribute | |
PTHREAD_PRIO_PROTECT and the calling thread's priority is higher | |
than the mutex's current priority calling. | |
-[EBUSY] The mutex could not be acquired because it was already locked. | |
It may fail if: | |
-[EINVAL] 'mutex' does not refer to an initialized mutex object | |
It shall not return [EINTR]. | |
</assertion> | |
</assertions> |