]> git.tuebingen.mpg.de Git - dss.git/commit
ipc: Simplify mutex_try_lock().
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 17 Jun 2016 07:18:40 +0000 (09:18 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 21 Aug 2016 19:13:25 +0000 (21:13 +0200)
commit03918564cf43cfbd4f873f1b9c6ec3ccd15ede91
tree26c7c36099956361db14c72ca63627c0240b334e
parent81d9c8b0e49a12f7b726b06e2df48c2c3314bbcb
ipc: Simplify mutex_try_lock().

There is no need to actually obtain the lock. A single semaphore
operation will do just fine. With sem_op equal to zero and IPC_NOWAIT
the semop() call returns immediately, and the return value tells
whether the semaphore value was zero.

Rename the (static) function to mutex_is_locked() to indicate that
it performs only read-only operations on the semaphore set.
ipc.c