From f70177e76e605ec6e6cd5b938fa77ade5d380e87 Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Mon, 22 Jan 1996 00:02:33 +0000 Subject: Reviewed by: julian and (hsu?) Submitted by: John Birrel(L?) changes for threadsafe operations --- lib/libc/stdlib/abort.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/libc/stdlib/abort.c') diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c index 690bdf5e48eb..f41500739fec 100644 --- a/lib/libc/stdlib/abort.c +++ b/lib/libc/stdlib/abort.c @@ -39,6 +39,10 @@ static char sccsid[] = "@(#)abort.c 8.1 (Berkeley) 6/4/93"; #include #include #include +#ifdef _THREAD_SAFE +#include +#include "pthread_private.h" +#endif void abort() @@ -51,15 +55,24 @@ abort() * any errors -- X311J doesn't allow abort to return anyway. */ sigdelset(&mask, SIGABRT); +#ifdef _THREAD_SAFE + (void) _thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#else (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#endif (void)kill(getpid(), SIGABRT); /* * if SIGABRT ignored, or caught and the handler returns, do * it again, only harder. */ +#ifdef _THREAD_SAFE + (void) _thread_sys_signal(SIGABRT, SIG_DFL); + (void) _thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#else (void)signal(SIGABRT, SIG_DFL); (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL); +#endif (void)kill(getpid(), SIGABRT); exit(1); } -- cgit v1.2.3