diff options
author | Miguel de Icaza <miguel@gnome.org> | 2005-05-03 02:41:21 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2005-05-03 02:41:21 +0400 |
commit | 1f5df3a0306c7948a1b95083e00342ff0bc2ecd8 (patch) | |
tree | a7840cde61f08c257f0208e7c266f123fe5a19c8 /libgc | |
parent | b16f9217e6f48aeea2c6a46bea0cd609a987661b (diff) |
2005-05-02 Miguel de Icaza <miguel@novell.com>
* 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
Diffstat (limited to 'libgc')
-rw-r--r-- | libgc/ChangeLog | 6 | ||||
-rw-r--r-- | libgc/pthread_stop_world.c | 18 |
2 files changed, 22 insertions, 2 deletions
diff --git a/libgc/ChangeLog b/libgc/ChangeLog index 4dc144b4e19..2707231a130 100644 --- a/libgc/ChangeLog +++ b/libgc/ChangeLog @@ -1,3 +1,9 @@ +2005-05-02 Miguel de Icaza <miguel@novell.com> + + * 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 <vargaz@freemail.hu> * configure.in: Applied another freebsd patch from Bill Middleton (flashdict@gmail.com). diff --git a/libgc/pthread_stop_world.c b/libgc/pthread_stop_world.c index 06e919b2848..60a63d5d8ac 100644 --- a/libgc/pthread_stop_world.c +++ b/libgc/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() |