summaryrefslogtreecommitdiff
path: root/pthread/cthreads-compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread/cthreads-compat.c')
-rw-r--r--pthread/cthreads-compat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pthread/cthreads-compat.c b/pthread/cthreads-compat.c
index e0536ef..cbe8170 100644
--- a/pthread/cthreads-compat.c
+++ b/pthread/cthreads-compat.c
@@ -100,5 +100,8 @@ __mutex_lock_solid (void *lock)
void
__mutex_unlock_solid (void *lock)
{
+ if (__pthread_spin_trylock (lock) != 0)
+ /* Somebody already got the lock, that one will manage waking up others */
+ return;
__pthread_mutex_unlock (lock);
}