|
From: <sv...@va...> - 2008-11-10 16:16:53
|
Author: sewardj
Date: 2008-11-10 16:16:46 +0000 (Mon, 10 Nov 2008)
New Revision: 8759
Log:
Make sure laog__handle_one_lock_deletion actually gets called as a
result of the client doing pthread_mutex_destroy() or
pthread_rwlock_destroy().
Modified:
trunk/helgrind/hg_main.c
Modified: trunk/helgrind/hg_main.c
===================================================================
--- trunk/helgrind/hg_main.c 2008-11-10 15:05:30 UTC (rev 8758)
+++ trunk/helgrind/hg_main.c 2008-11-10 16:16:46 UTC (rev 8759)
@@ -1040,8 +1040,10 @@
/*----------------------------------------------------------------*/
static void laog__pre_thread_acquires_lock ( Thread*, Lock* ); /* fwds */
-static void laog__handle_lock_deletions ( WordSetID ); /* fwds */
+//static void laog__handle_lock_deletions ( WordSetID ); /* fwds */
static inline Thread* get_current_Thread ( void ); /* fwds */
+__attribute__((noinline))
+static void laog__handle_one_lock_deletion ( Lock* lk ); /* fwds */
/* Block-copy states (needed for implementing realloc()). */
@@ -1870,6 +1872,7 @@
tl_assert( !lk->heldBy );
tl_assert( HG_(is_sane_LockN)(lk) );
+ laog__handle_one_lock_deletion(lk);
map_locks_delete( lk->guestaddr );
del_LockN( lk );
}
@@ -2185,6 +2188,7 @@
tl_assert( !lk->heldBy );
tl_assert( HG_(is_sane_LockN)(lk) );
+ laog__handle_one_lock_deletion(lk);
map_locks_delete( lk->guestaddr );
del_LockN( lk );
}
@@ -2943,29 +2947,29 @@
}
}
-__attribute__((noinline))
-static void laog__handle_lock_deletions (
- WordSetID /* in univ_laog */ locksToDelete
- )
-{
- Word i, ws_size;
- UWord* ws_words;
+//__attribute__((noinline))
+//static void laog__handle_lock_deletions (
+// WordSetID /* in univ_laog */ locksToDelete
+// )
+//{
+// Word i, ws_size;
+// UWord* ws_words;
+//
+// if (!laog)
+// laog = VG_(newFM)( HG_(zalloc), "hg.lhld.1", HG_(free), NULL/*unboxedcmp*/ );
+// if (!laog_exposition)
+// laog_exposition = VG_(newFM)( HG_(zalloc), "hg.lhld.2", HG_(free),
+// cmp_LAOGLinkExposition );
+//
+// HG_(getPayloadWS)( &ws_words, &ws_size, univ_lsets, locksToDelete );
+// for (i = 0; i < ws_size; i++)
+// laog__handle_one_lock_deletion( (Lock*)ws_words[i] );
+//
+// if (HG_(clo_sanity_flags) & SCE_LAOG)
+// all__sanity_check("laog__handle_lock_deletions-post");
+//}
- if (!laog)
- laog = VG_(newFM)( HG_(zalloc), "hg.lhld.1", HG_(free), NULL/*unboxedcmp*/ );
- if (!laog_exposition)
- laog_exposition = VG_(newFM)( HG_(zalloc), "hg.lhld.2", HG_(free),
- cmp_LAOGLinkExposition );
- HG_(getPayloadWS)( &ws_words, &ws_size, univ_lsets, locksToDelete );
- for (i = 0; i < ws_size; i++)
- laog__handle_one_lock_deletion( (Lock*)ws_words[i] );
-
- if (HG_(clo_sanity_flags) & SCE_LAOG)
- all__sanity_check("laog__handle_lock_deletions-post");
-}
-
-
/*--------------------------------------------------------------*/
/*--- Malloc/free replacements ---*/
/*--------------------------------------------------------------*/
|