When _PTHREADSINVARIANTS is defined SIGABRT is not included
in the set of signals to block. Also, make the PANIC macro call abort() instead of simply exiting.
This commit is contained in:
parent
4d233f6b0d
commit
393441d43b
@ -349,6 +349,9 @@ _thread_init(void)
|
||||
SIGEMPTYSET(_thread_suspend_sigset);
|
||||
SIGADDSET(_thread_suspend_sigset, SIGTHR);
|
||||
}
|
||||
#ifdef _PTHREADS_INVARIANTS
|
||||
SIGADDSET(_thread_suspend_sigset, SIGALRM);
|
||||
#endif
|
||||
|
||||
/* Get the kernel clockrate: */
|
||||
mib[0] = CTL_KERN;
|
||||
|
@ -77,6 +77,9 @@ _thread_sigblock()
|
||||
*/
|
||||
SIGFILLSET(set);
|
||||
SIGADDSET(set, SIGTHR);
|
||||
#ifdef _PTHREADS_INVARIANTS
|
||||
SIGDELSET(set, SIGABRT);
|
||||
#endif
|
||||
|
||||
/* If we have already blocked signals, just up the refcount */
|
||||
if (++curthread->signest > 1)
|
||||
|
@ -60,6 +60,7 @@
|
||||
#include <spinlock.h>
|
||||
#include <stdio.h>
|
||||
#include <ucontext.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <machine/atomic.h>
|
||||
#include <sys/thr.h>
|
||||
@ -68,8 +69,18 @@
|
||||
/*
|
||||
* Kernel fatal error handler macro.
|
||||
*/
|
||||
#define PANIC(string) _thread_exit(__FILE__,__LINE__,string)
|
||||
|
||||
#ifndef _PTHREADS_INVARIANTS
|
||||
#define PANIC(string) _thread_exit(__FILE__, __LINE__, (string))
|
||||
#else /* _PTHREADS_INVARIANTS */
|
||||
#define PANIC(string) \
|
||||
do { \
|
||||
_thread_printf(STDOUT_FILENO, (string)); \
|
||||
_thread_printf(STDOUT_FILENO, \
|
||||
"\nAbnormal termination, file: %s, line: %d\n", \
|
||||
__FILE__, __LINE__); \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#endif /* !_PTHREADS_INVARIANTS */
|
||||
|
||||
/* Output debug messages like this: */
|
||||
#define stdout_debug(args...) _thread_printf(STDOUT_FILENO, args)
|
||||
|
Loading…
x
Reference in New Issue
Block a user