]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merged r9577:9578 from trunk to here (fixes #189763).
authorBart Van Assche <bvanassche@acm.org>
Wed, 22 Apr 2009 19:15:50 +0000 (19:15 +0000)
committerBart Van Assche <bvanassche@acm.org>
Wed, 22 Apr 2009 19:15:50 +0000 (19:15 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_4_BRANCH@9579

drd/drd_pthread_intercepts.c

index 9f5c3a848562a639d6f5bfba0ceca5dcaecc2032..ed81aaa9090241af5e8cd77b3576ba2fa4b60f58 100644 (file)
@@ -260,6 +260,24 @@ static void vg_set_main_thread_state(void)
 
 }
 
+
+/*
+ * Note: as of today there exist three different versions of pthread_create:
+ * - pthread_create@GLIBC_2.0
+ * - pthread_create@@GLIBC_2.1
+ * - pthread_create@@GLIBC_2.2.5
+ * As an example, in libpthread-2.3.4 both pthread_create@GLIBC_2.0 and
+ * pthread_create@@GLIBC_2.1 are defined, while in libpthread-2.9 all three
+ * versions have been implemented. In any glibc version where more than one
+ * pthread_create function has been implemented, older versions call the
+ * newer versions. Or: the pthread_create* wrapper defined below can be
+ * called recursively. Any code in this wrapper should take this in account.
+ * As an example, it is not safe to invoke the DRD_STOP_RECORDING
+ * / DRD_START_RECORDING client requests from the pthread_create wrapper.
+ * See also the implementation of pthread_create@GLIBC_2.0 in
+ * glibc-2.9/nptl/pthread_create.c.
+ */
+
 // pthread_create
 PTH_FUNC(int, pthreadZucreateZa, // pthread_create*
          pthread_t *thread, const pthread_attr_t *attr,
@@ -292,12 +310,7 @@ 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);