]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't assert when destroying a locked rwlock.
authorJulian Seward <jseward@acm.org>
Thu, 29 Nov 2007 12:53:25 +0000 (12:53 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 29 Nov 2007 12:53:25 +0000 (12:53 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7250

helgrind/hg_main.c

index 2dd8fcbf21434d9aae3f7db4d00ecce51ef2e875..d9deacdd3f2bf29756615e075d271724b29dfbba 100644 (file)
@@ -312,8 +312,9 @@ typedef
       /* EXPOSITION */
       /* Place where lock first came to the attention of Helgrind. */
       ExeContext*   appeared_at;
-      /* Place where the lock most recently made an unlocked->locked
-         transition. */
+      /* If the lock is held, place where the lock most recently made
+         an unlocked->locked transition.  Must be sync'd with .heldBy:
+         either both NULL or both non-NULL. */
       ExeContext*   acquired_at;
       /* USEFUL-STATIC */
       Addr          guestaddr; /* Guest address of lock */
@@ -6240,6 +6241,7 @@ void evh__HG_PTHREAD_RWLOCK_DESTROY_PRE( ThreadId tid, void* rwl )
          HG_(deleteBag)( lk->heldBy );
          lk->heldBy = NULL;
          lk->heldW = False;
+         lk->acquired_at = False;
       }
       tl_assert( !lk->heldBy );
       tl_assert( is_sane_LockN(lk) );