diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-13 08:13:49 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-13 08:13:49 -0800 |
commit | 1964bb94f82d3d81eec3d5797fe875741a9a8182 (patch) | |
tree | 445c44f7caf3e3ced5d9dd46e89db6c9a75ca802 /signal.c | |
parent | a846f5e378a1c03ae122c711308899bbe381a7f1 (diff) | |
download | txr-1964bb94f82d3d81eec3d5797fe875741a9a8182.tar.gz txr-1964bb94f82d3d81eec3d5797fe875741a9a8182.tar.bz2 txr-1964bb94f82d3d81eec3d5797fe875741a9a8182.zip |
* signal.c (sig_handler): Pass two arguments to signal
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.
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -59,7 +59,8 @@ static void sig_handler(int sig) if (lambda) { if (async_sig_enabled) { async_sig_enabled = 0; - funcall1(lambda, num_fast(sig)); + if (funcall2(lambda, num_fast(sig), t)) + sig_deferred |= (1UL << sig); async_sig_enabled = 1; } else { sig_deferred |= (1UL << sig); @@ -191,7 +192,7 @@ val sig_check(void) if ((sd & mask) != 0) { sd &= ~mask; sig_deferred = sd; - funcall1(sig_lambda[i], num_fast(i)); + funcall2(sig_lambda[i], num_fast(i), nil); } } |