_mutex_trylock():
* The loop is unnecessary, since the call doesn't block anyway, so it can't be interrupted. * Set the holder, if KDEBUG is enabled. Otherwise the panic() in recursive_lock_unlock() would be triggered. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29556 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -154,11 +154,13 @@ mutex_destroy(mutex *mutex)
|
|||||||
status_t
|
status_t
|
||||||
_mutex_trylock(mutex *mutex)
|
_mutex_trylock(mutex *mutex)
|
||||||
{
|
{
|
||||||
status_t status;
|
status_t status = acquire_sem_etc((sem_id)mutex->waiters, 1,
|
||||||
do {
|
B_RELATIVE_TIMEOUT, 0);
|
||||||
status = acquire_sem_etc((sem_id)mutex->waiters, 1, B_RELATIVE_TIMEOUT,
|
|
||||||
0);
|
#if KDEBUG
|
||||||
} while (status == B_INTERRUPTED);
|
if (status == B_OK)
|
||||||
|
mutex->holder = find_thread(NULL);
|
||||||
|
#endif
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user