From 58554e14f9995fdafe2338a69a42d9192b96f712 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Fri, 26 Sep 2008 09:57:11 +0200
Subject: notify: protect notify->pending with the mutex

There was a known deadlocking bug in the notify library: when the
other thread set notify->pending after the according check in
notify_wait(), the latter thread was deadlocked.  Resolve this by
synchronizing all accesses to notify->pending with the notify object's
mutex.  Since notify_signal_sync() was never used, we can remove it.
As a consequence, we don't need notify_enter() and notify_leave()
anymore; eliminate them, too.
---
 src/main_notify.c | 2 --
 1 file changed, 2 deletions(-)

(limited to 'src/main_notify.c')

diff --git a/src/main_notify.c b/src/main_notify.c
index 4e5b786a2..96fb374b5 100644
--- a/src/main_notify.c
+++ b/src/main_notify.c
@@ -115,8 +115,6 @@ void wait_main_task(void)
 {
 	assert(pthread_equal(main_task, pthread_self()));
 
-	notify_enter(&main_notify);
 	notify_wait(&main_notify);
-	notify_leave(&main_notify);
 }
 
-- 
cgit v1.2.3