| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: we are using sigsetjmp but with a jmp_buf structure;
it requires sigjmp_buf!
Performance issue: sigsetjmp is a dog which makes system calls.
Solution: let's roll our own cached version of sigprocmask which
only calls the real sigprocmask when the mask changes. Then
our extended_setjmp will just use regular setjmp, plus our own
custom signal saving and restoring based on the cached version.
* signal.c (sig_blocked_cache): New variable.
(set_sig_handler): Use our sig_mask instead of sigprocmask.
(mem_set_bits, mem_clr_bits): New static functions.
(sig_mask): New function.
* signal.h (extended_jmp_buf): New member, blocked.
(extended_setjmp): save blocked signals by peeking into
sig_blocked_cache, and restore using sig_mask.
(sig_blocked_cache, sig_mask): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
handler rather than 1. The new argument is the value t,
telling the handler that it's asynchronously invoked in
a real signal context. If the signal handler returns
true, then mark it deferred so that it can re-trigger
in a synchronous context.
(sig_check): Pass nil as a the second argument to signal handlers,
indicating that they are synchronously called, not
in a signal handler context.
* txr.1: Added documentation.
|
|
|
|
|
| |
function because it manipulates the mask of deferred
signals which can also be manipulated by an async signal.
|
|
|
|
|
|
| |
for a signal that is being set to ignored or default.
* txr.1: Documented signals.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* signal.c (sig_hup, sig_int, sig_quit, sig_ill, sig_trap, sig_abrt,
sig_bus, val sig_fpe, sig_kill, sig_usr1, sig_segv, sig_usr2, sig_pipe,
sig_alrm, val sig_term, sig_chld, sig_cont, sig_stop, sig_tstp,
sig_ttin, val sig_ttou, sig_urg, sig_xcpu, sig_xfsz, sigtalrm,
sig_prof, val sig_poll, sig_sys, sig_winch, sig_iot, sig_stkflt,
sig_io, sig_lost, sig_pwr): New variables.
(sig_init): New variables initialized.
* signal.h: New variables declared.
|
|
* Makefile (OBJS-y): Include signal.o if have_posix_sigs is "y".
* configure (have_posix_sigs): New variable, set by detecting POSIX
signal stuff.
* dep.mk: Regenerated.
* arith.c, debug.c, eval.c, filter.c, hash.c, match.c, parser.y,
parser.l, rand.c, regex.c, syslog.c, txr.c, utf8.c: Include new
signal.h header, now required by unwind, and the <signal.h> system
header.
* eval.c (exit_wrap): New function.
(eval_init): New functions registered as intrinsics: exit_wrap,
set_sig_handler, get_sig_handler, sig_check.
* gc.c (release): Unused functions removed.
* gc.h (release): Declaration removed.
* lib.c (init): Call sig_init.
* stream.c (set_putc, se_getc, se_fflush): New static functions.
(stdio_put_char_callback, stdio_get_char_callback, stdio_put_byte,
stdio_flush, stdio_get_byte): Use new functions to enable
signals when blocked on I/O.
(tail_strategy): Allow signals across sleep.
(pipev_close): Allow signals across waitpid.
(se_pclose): New static function.
(pipe_close): Use new function to enable signals across pclose.
* unwind.c (uw_unwind_to_exit_point): use extended_longjmp instead of
longjmp.
* unwind.h (struct uw_block, struct uw_catch): jb member changes from
jmp_buf to extended_jmp_buf.
(uw_block_begin, uw_simple_catch_begin, uw_catch_begin): Use
extended_setjmp instead of setjmp.
* signal.c: New file.
* signal.h: New file.
|