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(); }