|
From: <sv...@va...> - 2008-04-22 23:07:10
|
Author: sewardj
Date: 2008-04-23 00:07:12 +0100 (Wed, 23 Apr 2008)
New Revision: 7911
Log:
Fix invalid assertion when unlocking a reader-writer lock (Konstantin
Serebryany).
Modified:
branches/HGDEV/helgrind/hg_main.c
Modified: branches/HGDEV/helgrind/hg_main.c
===================================================================
--- branches/HGDEV/helgrind/hg_main.c 2008-04-22 23:01:15 UTC (rev 7910)
+++ branches/HGDEV/helgrind/hg_main.c 2008-04-22 23:07:12 UTC (rev 7911)
@@ -6054,7 +6054,12 @@
tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (Word)lock ));
} else {
/* We no longer hold the lock. */
- tl_assert(HG_(isEmptyBag)(&lock->heldBy));
+ if (!isRDWR) {
+ // This is a pure Mutex and it should not be held by anyone.
+ // We can not do the same for rw-locks since a reader lock
+ // can be held by other thread.
+ tl_assert(HG_(isEmptyBag)(&lock->heldBy));
+ }
tl_assert(0 == HG_(elemBag)( &lock->heldBy, (Word)thr ));
/* update this thread's lockset accordingly. */
thr->locksetA
|