]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Suppressed reports about data races during thread creation.
authorBart Van Assche <bvanassche@acm.org>
Fri, 4 Apr 2008 19:10:21 +0000 (19:10 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 4 Apr 2008 19:10:21 +0000 (19:10 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7843

exp-drd/drd_clientreq.c
exp-drd/drd_clientreq.h
exp-drd/drd_pthread_intercepts.c

index e8c19d19455a4a9835f59067fcfcad4ff2ec6c7e..481ad17c1a7e782aa69ef54175f7f063c952cfde 100644 (file)
@@ -140,6 +140,14 @@ static Bool drd_handle_client_request(ThreadId vg_tid, UWord* arg, UWord* ret)
     drd_stop_tracing_address_range(arg[1], arg[1] + arg[2]);
     break;
 
+  case VG_USERREQ__DRD_STOP_RECORDING:
+    thread_stop_recording(drd_tid);
+    break;
+
+  case VG_USERREQ__DRD_START_RECORDING:
+    thread_start_recording(drd_tid);
+    break;
+
   case VG_USERREQ__SET_PTHREADID:
     thread_set_pthreadid(drd_tid, arg[1]);
     break;
index 81d8320dc4b8bd14e86ebc5087d809501da43d48..46f56e241ceae1e9f531bc94959a3539648c35dd 100644 (file)
@@ -35,6 +35,12 @@ enum {
   /* To ask the drd tool to stop tracing accesses to the specified range. */
   VG_USERREQ__DRD_STOP_TRACE_ADDR,
   /* args: Addr, SizeT. */
+  /* Let the drd tool stop recording memory accesses in the calling thread. */
+  VG_USERREQ__DRD_STOP_RECORDING,
+  /* args: none. */
+  /* Let the drd tool start recording memory accesses in the calling thread. */
+  VG_USERREQ__DRD_START_RECORDING,
+  /* args: none. */
 
   /* Tell the core the pthread_t of the running thread */
   VG_USERREQ__SET_PTHREADID,
index aabac05894923aa3391da5a3027020d26ebb5c87..2c1b7734dad920e595390155e65673ca2b80c85a 100644 (file)
@@ -244,6 +244,7 @@ PTH_FUNC(int, pthreadZucreateZa, // pthread_create*
          pthread_t *thread, const pthread_attr_t *attr,
          void *(*start) (void *), void *arg)
 {
+  int    res;
   int    ret;
   OrigFn fn;
   VgPosixThreadArgs vgargs;
@@ -270,7 +271,12 @@ PTH_FUNC(int, pthreadZucreateZa, // pthread_create*
   pthread_cond_init(&vgargs.cond, 0);
   pthread_mutex_lock(&vgargs.mutex);
 #endif
+  /* Suppress NPTL-specific conflicts between creator and created thread. */
+  VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_STOP_RECORDING,
+                             0, 0, 0, 0, 0);
   CALL_FN_W_WWWW(ret, fn, thread, attr, vg_thread_wrapper, &vgargs);
+  VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_START_RECORDING,
+                             0, 0, 0, 0, 0);
 #if 0
   pthread_cond_wait(&vgargs.cond, &vgargs.mutex);
   pthread_mutex_unlock(&vgargs.mutex);