other versions
- jessie 3.16.56-1+deb8u1
MUTEX_TRYLOCK(9) | Mutex API reference | MUTEX_TRYLOCK(9) |
NAME¶
mutex_trylock - try to acquire the mutex, without waitingSYNOPSIS¶
int __sched
mutex_trylock(struct mutex * lock);
ARGUMENTS¶
lockthe mutex to be acquired
DESCRIPTION¶
Try to acquire the mutex atomically. Returns 1 if the mutex has been acquired successfully, and 0 on contention.NOTE¶
this function follows the spin_trylock convention, so it is negated from the down_trylock return values! Be careful about this when converting semaphore users to mutexes. This function must not be used in interrupt context. The mutex must be released by the same task that acquired it.AUTHOR¶
Rusty Russell <rusty@rustcorp.com.au>Author.
COPYRIGHT¶
May 2018 | Kernel Hackers Manual 3.16 |