|
From: <sv...@va...> - 2005-05-13 22:09:28
|
Author: njn
Date: 2005-05-13 23:09:26 +0100 (Fri, 13 May 2005)
New Revision: 3698
Modified:
trunk/coregrind/core.h
trunk/coregrind/linux/core_os.c
Log:
VGA_(terminate) doesn't need to be exported.
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-05-13 22:07:12 UTC (rev 3697)
+++ trunk/coregrind/core.h 2005-05-13 22:09:26 UTC (rev 3698)
@@ -886,9 +886,6 @@
// Return how many bytes of a thread's Valgrind stack are unused
SSizeT VGA_(stack_unused)(ThreadId tid);
=20
-// 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);
=20
Modified: trunk/coregrind/linux/core_os.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/linux/core_os.c 2005-05-13 22:07:12 UTC (rev 3697)
+++ trunk/coregrind/linux/core_os.c 2005-05-13 22:09:26 UTC (rev 3698)
@@ -45,6 +45,33 @@
VGA_(os_state_clear)(tst);
}
=20
+static void terminate(ThreadId tid, VgSchedReturnCode src)
+{
+ vg_assert(tid =3D=3D VG_(master_tid));
+ vg_assert(VG_(count_living_threads)() =3D=3D 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 !=3D 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,37 +105,10 @@
=20
if (tid =3D=3D VG_(master_tid)) {
VG_(shutdown_actions)(tid);
- VGA_(terminate)(tid, ret);
+ terminate(tid, ret);
}
}
=20
-void VGA_(terminate)(ThreadId tid, VgSchedReturnCode src)
-{
- vg_assert(tid =3D=3D VG_(master_tid));
- vg_assert(VG_(count_living_threads)() =3D=3D 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 !=3D 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");
- }
-}
-
/* wait until all other threads are dead */
static Bool alldead(void *v)
{
|