From cafcffd4b12b855cc2de891f5620ed0fd6f11cd7 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Mon, 26 Jan 2009 08:39:37 +0100 Subject: [PATCH] add check to chained locking validating that the parent lock is held --- src/lib/mutex.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/mutex.h b/src/lib/mutex.h index 901a885ba..a6943d5a5 100644 --- a/src/lib/mutex.h +++ b/src/lib/mutex.h @@ -73,6 +73,7 @@ lumiera_lock_section_.lock;) \ for ( \ ({ \ + REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_lock_section_.lock = &(mtx)->mutex; \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire mutex", &lumiera_lock_section_, \ @@ -123,6 +124,7 @@ lumiera_lock_section_.lock;) \ for ( \ ({ \ + REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_lock_section_.lock = &(mtx)->recmutex; \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire recmutex", &lumiera_lock_section_, \