Author: bart
Date: 2008-03-01 07:25:13 +0000 (Sat, 01 Mar 2008)
New Revision: 7516

Log:
When started with linuxthreads, the DRD tool now stops as soon as the first 
thread is created.

Modified:
   trunk/exp-drd/drd_intercepts.c


Modified: trunk/exp-drd/drd_intercepts.c
===================================================================
--- trunk/exp-drd/drd_intercepts.c      2008-02-29 19:49:06 UTC (rev 7515)
+++ trunk/exp-drd/drd_intercepts.c      2008-03-01 07:25:13 UTC (rev 7516)
@@ -50,6 +50,7 @@
 #include <pthread.h>
 #include <semaphore.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include "drd_clientreq.h"
 #include "pub_tool_redir.h"
@@ -81,6 +82,7 @@
 // Local variables.
 
 static int vg_main_thread_state_is_set = 0;
+static pid_t vg_main_thread_pid;
 
 
 // Function definitions.
@@ -160,6 +162,17 @@
 static void* vg_thread_wrapper(void* arg)
 {
    int res;
+
+   if (getpid() != vg_main_thread_pid)
+   {
+      fprintf(stderr,
+             "Detected the linuxthreads threading library.\n"
+             "Sorry, but DRD does not support linuxthreads.\n"
+             "Please try to run DRD on a system with NPTL instead.\n"
+             "Giving up.\n");
+      abort();
+   }
+
    VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK,
                               0, 0, 0, 0, 0);
 
@@ -189,6 +202,8 @@
 {
    int res;
 
+   vg_main_thread_pid = getpid();
+
    VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK,
                               0, 0, 0, 0, 0);
 


-------------------------------------------------------------------------
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