Fix 324227  memcheck false positive leak when a thread calls exit+block
only reachable via other thread live register

The exiting thread will have its registers considered as not reachable
anymore, registers of other threads will be considered reachable.

This is ensured by using a different exit reason for the
exiting thread and for the other threads.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13670 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/pub_core_threadstate.h b/coregrind/pub_core_threadstate.h
index 64a08a7..7a9611b 100644
--- a/coregrind/pub_core_threadstate.h
+++ b/coregrind/pub_core_threadstate.h
@@ -70,7 +70,8 @@
    enum { 
       VgSrc_None,	 /* not exiting yet */
       VgSrc_ExitThread,  /* just this thread is exiting */
-      VgSrc_ExitProcess, /* entire process is exiting */
+      VgSrc_ExitProcess, /* this thread is exiting due to another thread
+                            calling exit() */
       VgSrc_FatalSig	 /* Killed by the default action of a fatal
 			    signal */
    }
@@ -388,6 +389,9 @@
 // Convert a ThreadStatus to a string.
 const HChar* VG_(name_of_ThreadStatus) ( ThreadStatus status );
 
+// Convert a VgSchedReturnCode to a string.
+const HChar* VG_(name_of_VgSchedReturnCode) ( VgSchedReturnCode retcode );
+
 /* Get the ThreadState for a particular thread */
 extern ThreadState *VG_(get_ThreadState) ( ThreadId tid );