From d6d2e3b99cc652db4d32c62b86012e2d58210195 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 2 May 2005 22:41:21 +0000 Subject: [PATCH] 2005-05-02 Miguel de Icaza * pthread_stop_world.c (GC_restart_handler, GC_suspend_handler): Wrap the original routines into methods that preserve the value of errno. Fixes #74740 svn path=/trunk/mono/; revision=43905 --- ChangeLog | 6 ++++++ pthread_stop_world.c | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 600fa55a..62c2c78e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-05-02 Miguel de Icaza + + * pthread_stop_world.c (GC_restart_handler, GC_suspend_handler): + Wrap the original routines into methods that preserve the value of + errno. Fixes #74740 + 2005-04-18 Zoltan Varga * configure.in: Applied another freebsd patch from Bill Middleton (flashdict@gmail.com). diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 06e919b2..60a63d5d 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -101,7 +101,7 @@ word GC_stop_count; /* Incremented at the beginning of GC_stop_world. */ sem_t GC_suspend_ack_sem; -void GC_suspend_handler(int sig) +static void _GC_suspend_handler(int sig) { int dummy; pthread_t my_thread = pthread_self(); @@ -168,7 +168,14 @@ void GC_suspend_handler(int sig) #endif } -void GC_restart_handler(int sig) +void GC_suspend_handler(int sig) +{ + int old_errno = errno; + _GC_suspend_handler(sig); + errno = old_errno; +} + +static void _GC_restart_handler(int sig) { pthread_t my_thread = pthread_self(); GC_thread me; @@ -270,6 +277,13 @@ static void pthread_push_all_stacks() ABORT("Collecting from unknown thread."); } +void GC_restart_handler(int sig) +{ + int old_errno = errno; + _GC_restart_handler (sig); + errno = old_errno; +} + /* We hold allocation lock. Should do exactly the right thing if the */ /* world is stopped. Should not fail if it isn't. */ void GC_push_all_stacks() -- 2.40.0