]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Suppress data race reports for the data race triggered by Darwin's pthread_once(...
authorBart Van Assche <bvanassche@acm.org>
Sun, 26 Jul 2009 15:55:48 +0000 (15:55 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 26 Jul 2009 15:55:48 +0000 (15:55 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10616

drd/drd_pthread_intercepts.c

index 7639f10102fa4876aac6de9be4c16b5d4400f647..a30adba3d286abacfb4f4e092c6f2c1b1d095292 100644 (file)
@@ -453,6 +453,24 @@ PTH_FUNC(int, pthreadZucancelZa, pthread_t pt_thread)
    return ret;
 }
 
+// pthread_once
+PTH_FUNC(int, pthreadZuonceZa, // pthread_once*
+         pthread_once_t *once_control, void (*init_routine)(void))
+{
+   int ret;
+   OrigFn fn;
+   VALGRIND_GET_ORIG_FN(fn);
+   /*
+    * Ignore any data races triggered by the implementation of pthread_once().
+    * Necessary for Darwin. This is not necessary for Linux but doesn't have
+    * any known adverse effects.
+    */
+   DRD_IGNORE_VAR(once_control);
+   CALL_FN_W_WW(ret, fn, once_control, init_routine);
+   DRD_STOP_IGNORING_VAR(once_control);
+   return ret;
+}
+
 // pthread_mutex_init
 PTH_FUNC(int, pthreadZumutexZuinit,
          pthread_mutex_t *mutex,