posixcompat: fixed pthread_mutex_lock to work with nested calls.
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Fri, 6 Feb 2015 10:11:00 +0000 (11:11 +0100)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 9 Mar 2015 14:33:31 +0000 (15:33 +0100)
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>

lib/posixcompat/pthreads.c

index 06502c5..8112f2e 100644 (file)
@@ -170,7 +170,7 @@ int pthread_mutex_lock(pthread_mutex_t *mutex)
 
     (*mutex)->locked++;
     thread_mutex_unlock(&mutex_mutex);
-    thread_mutex_lock(&(*mutex)->mutex);
+    thread_mutex_lock_nested(&(*mutex)->mutex);
     return 0;
 }