Author: bart
Date: 2008-02-28 20:27:34 +0000 (Thu, 28 Feb 2008)
New Revision: 7503

Log:
Removed calls to set_thread_name() because the calls to snprintf() caused data 
races.

Modified:
   trunk/exp-drd/tests/pth_detached.c


Modified: trunk/exp-drd/tests/pth_detached.c
===================================================================
--- trunk/exp-drd/tests/pth_detached.c  2008-02-28 19:54:29 UTC (rev 7502)
+++ trunk/exp-drd/tests/pth_detached.c  2008-02-28 20:27:34 UTC (rev 7503)
@@ -12,16 +12,6 @@
 static int s_finished_count;
 static pthread_mutex_t s_mutex;
 
-static void set_thread_name(const char* const fmt, const int arg)
-{
-  int res;
-  char name[32];
-  snprintf(name, sizeof(name), fmt, arg);
-  name[sizeof(name) - 1] = 0;
-  VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__SET_THREAD_NAME,
-                             name, 0, 0, 0, 0);
-}
-
 void increment_finished_count()
 {
   pthread_mutex_lock(&s_mutex);
@@ -40,7 +30,6 @@
 
 static void* thread_func1(void* arg)
 {
-  set_thread_name("thread_func1[%d]", *(int*)arg);
   write(STDOUT_FILENO, ".", 1);
   increment_finished_count();
   return 0;
@@ -48,7 +37,6 @@
 
 static void* thread_func2(void* arg)
 {
-  set_thread_name("thread_func2[%d]", *(int*)arg);
   pthread_detach(pthread_self());
   write(STDOUT_FILENO, ".", 1);
   increment_finished_count();
@@ -64,8 +52,6 @@
   int detachstate;
   pthread_attr_t attr;
 
-  set_thread_name("main", 0);
-
   for (i = 0; i < count1 || i < count2; i++)
     thread_arg[i] = i;
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to