options/posix: Fix incorrect deadlock detection in pthread_mutex_trylock
@@ -822,11 +822,7 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex) {
// If this (recursive) mutex is already owned by us, increment the recursion level.
if((expected & mutex_owner_mask) == this_tid()) {
if(!(mutex->__mlibc_flags & mutexRecursive)) {
- if (mutex->__mlibc_flags & mutexErrorCheck)
- return EDEADLK;
- else
- mlibc::panicLogger() << "mlibc: pthread_mutex deadlock detected!"
- << frg::endlog;
+ return EBUSY;
}
++mutex->__mlibc_recursion;
return 0;
