]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
VGA_(terminate) doesn't need to be exported.
authorNicholas Nethercote <njn@valgrind.org>
Fri, 13 May 2005 22:09:26 +0000 (22:09 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Fri, 13 May 2005 22:09:26 +0000 (22:09 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3698

coregrind/core.h
coregrind/linux/core_os.c

index 8c6d2ca999dec9bc474e1adf674ff0641b0c06ef..feca949afc335fc6db66fc9dacfb4048a1340ef5 100644 (file)
@@ -886,9 +886,6 @@ void VGA_(main_thread_wrapper)(ThreadId tid) __attribute__ ((__noreturn__));
 // Return how many bytes of a thread's Valgrind stack are unused
 SSizeT VGA_(stack_unused)(ThreadId tid);
 
-// Terminate the process.  Does not return.
-void VGA_(terminate)(ThreadId tid, VgSchedReturnCode src) __attribute__((__noreturn__));
-
 // wait until all other threads are dead
 extern void VGA_(reap_threads)(ThreadId self);
 
index c5d990d5e515cdc4e137995e65f49d77455580fd..93a16611915d980e41349187f7df188a9714d7c4 100644 (file)
@@ -45,6 +45,33 @@ void VGA_(os_state_init)(ThreadState *tst)
    VGA_(os_state_clear)(tst);
 }
 
+static void terminate(ThreadId tid, VgSchedReturnCode src)
+{
+   vg_assert(tid == VG_(master_tid));
+   vg_assert(VG_(count_living_threads)() == 0);
+
+   //--------------------------------------------------------------
+   // Exit, according to the scheduler's return code
+   //--------------------------------------------------------------
+   switch (src) {
+   case VgSrc_ExitSyscall: /* the normal way out */
+      VG_(exit)( VG_(threads)[VG_(master_tid)].os_state.exitcode );
+      /* NOT ALIVE HERE! */
+      VG_(core_panic)("entered the afterlife in main() -- ExitSyscall");
+      break; /* what the hell :) */
+
+   case VgSrc_FatalSig:
+      /* We were killed by a fatal signal, so replicate the effect */
+      vg_assert(VG_(threads)[VG_(master_tid)].os_state.fatalsig != 0);
+      VG_(kill_self)(VG_(threads)[VG_(master_tid)].os_state.fatalsig);
+      VG_(core_panic)("main(): signal was supposed to be fatal");
+      break;
+
+   default:
+      VG_(core_panic)("main(): unexpected scheduler return code");
+   }
+}
+
 /* Run a thread from beginning to end. Does not return. */
 void VGA_(thread_wrapper)(Word /*ThreadId*/ tidW)
 {
@@ -78,34 +105,7 @@ void VGA_(thread_wrapper)(Word /*ThreadId*/ tidW)
    
    if (tid == VG_(master_tid)) {
       VG_(shutdown_actions)(tid);
-      VGA_(terminate)(tid, ret);
-   }
-}
-
-void VGA_(terminate)(ThreadId tid, VgSchedReturnCode src)
-{
-   vg_assert(tid == VG_(master_tid));
-   vg_assert(VG_(count_living_threads)() == 0);
-
-   //--------------------------------------------------------------
-   // Exit, according to the scheduler's return code
-   //--------------------------------------------------------------
-   switch (src) {
-   case VgSrc_ExitSyscall: /* the normal way out */
-      VG_(exit)( VG_(threads)[VG_(master_tid)].os_state.exitcode );
-      /* NOT ALIVE HERE! */
-      VG_(core_panic)("entered the afterlife in main() -- ExitSyscall");
-      break; /* what the hell :) */
-
-   case VgSrc_FatalSig:
-      /* We were killed by a fatal signal, so replicate the effect */
-      vg_assert(VG_(threads)[VG_(master_tid)].os_state.fatalsig != 0);
-      VG_(kill_self)(VG_(threads)[VG_(master_tid)].os_state.fatalsig);
-      VG_(core_panic)("main(): signal was supposed to be fatal");
-      break;
-
-   default:
-      VG_(core_panic)("main(): unexpected scheduler return code");
+      terminate(tid, ret);
    }
 }