From 5547d1545e6728332cec793afeb3acf348073f13 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 24 Aug 2011 15:02:21 +0000 Subject: [PATCH] drd: Avoid reporting false positive race reports inside pthread_join(). Note: I haven't analyzed yet since which commit these false positives started to appear but it's most likely a commit applied after the 3.6 release. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12003 --- drd/drd_pthread_intercepts.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c index 856092fa6e..5b13bb30b6 100644 --- a/drd/drd_pthread_intercepts.c +++ b/drd/drd_pthread_intercepts.c @@ -483,12 +483,18 @@ int pthread_join_intercept(pthread_t pt_joinee, void **thread_return) OrigFn fn; VALGRIND_GET_ORIG_FN(fn); + /* + * Avoid that the sys_futex(td->tid) call invoked by the NPTL pthread_join() + * implementation triggers a (false positive) race report. + */ + ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN(); CALL_FN_W_WW(ret, fn, pt_joinee, thread_return); if (ret == 0) { VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_THREAD_JOIN, pt_joinee, 0, 0, 0, 0); } + ANNOTATE_IGNORE_READS_AND_WRITES_END(); return ret; } -- 2.47.2