From 7686d00c6f69e4e069f55f541fb0dc4af82c2928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 4 Apr 2008 15:11:37 +0000 Subject: [PATCH] * 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 --- src/system/kernel/cache/block_cache.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/cache/block_cache.cpp b/src/system/kernel/cache/block_cache.cpp index dc2bb667f6..b47217fe1e 100644 --- a/src/system/kernel/cache/block_cache.cpp +++ b/src/system/kernel/cache/block_cache.cpp @@ -1369,11 +1369,14 @@ wait_for_notifications(block_cache *cache) cache_notification notification; set_notification(NULL, notification, TRANSACTION_WRITTEN, notify_sync, cache); + + ConditionVariableEntry entry; + entry.Add(cache); + add_notification(cache, ¬ification, TRANSACTION_WRITTEN, false); - // wait for condition - ConditionVariableEntry entry; - entry.Wait(cache); + // wait for notification hook to be called + entry.Wait(); }