* This should fix a deadlock as reported by bga.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24793 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-04-04 15:11:37 +00:00
parent 807d3aa8e3
commit 7686d00c6f
+6 -3
View File
@@ -1369,11 +1369,14 @@ wait_for_notifications(block_cache *cache)
cache_notification notification;
set_notification(NULL, notification, TRANSACTION_WRITTEN, notify_sync,
cache);
ConditionVariableEntry<block_cache> entry;
entry.Add(cache);
add_notification(cache, &notification, TRANSACTION_WRITTEN, false);
// wait for condition
ConditionVariableEntry<block_cache> entry;
entry.Wait(cache);
// wait for notification hook to be called
entry.Wait();
}