summaryrefslogtreecommitdiff
path: root/libguile/async.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2002-10-05 13:06:58 +0000
committerMarius Vollmer <mvo@zagadka.de>2002-10-05 13:06:58 +0000
commitf6b44bd99f1d4ae963dfb3aaa66a30e9c1574924 (patch)
tree3bdc760eadd65aaf3c9db4e5452779e2e7f00705 /libguile/async.c
parent5e405a6055fdd097d765d126f2a90e0a80adade2 (diff)
downloadguile-f6b44bd99f1d4ae963dfb3aaa66a30e9c1574924.tar.gz
* async.c (scm_async_click): Set the cdr of a executed handler
cell to SCM_BOOL_F, not SCM_EOL. (scm_i_queue_async_cell): Queue the cell at the end of the list, and only if the handler procedure is not already present. (scm_system_async_mark_for_thread): Initialize cdr of handler cell with SCM_BOOL_F. * scmsigs.c (scm_sigaction_for_thread): Likewise.
Diffstat (limited to 'libguile/async.c')
-rw-r--r--libguile/async.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/libguile/async.c b/libguile/async.c
index 53edabda2..06fe0b75b 100644
--- a/libguile/async.c
+++ b/libguile/async.c
@@ -179,7 +179,7 @@ scm_async_click ()
do
{
SCM c = SCM_CDR (asyncs);
- SCM_SETCDR (asyncs, SCM_EOL);
+ SCM_SETCDR (asyncs, SCM_BOOL_F);
scm_call_0 (SCM_CAR (asyncs));
asyncs = c;
}
@@ -204,10 +204,23 @@ SCM_DEFINE (scm_system_async, "system-async", 1, 0, 0,
void
scm_i_queue_async_cell (SCM c, scm_root_state *root)
{
- if (SCM_CDR (c) == SCM_EOL)
+ if (SCM_CDR (c) == SCM_BOOL_F)
{
- SCM_SETCDR (c, root->active_asyncs);
- root->active_asyncs = c;
+ SCM p = root->active_asyncs;
+ SCM_SETCDR (c, SCM_EOL);
+ if (p == SCM_EOL)
+ root->active_asyncs = c;
+ else
+ {
+ SCM pp;
+ while ((pp = SCM_CDR(p)) != SCM_EOL)
+ {
+ if (SCM_CAR (p) == SCM_CAR (c))
+ return;
+ p = pp;
+ }
+ SCM_SETCDR (p, c);
+ }
}
}
@@ -218,7 +231,7 @@ SCM_DEFINE (scm_system_async_mark_for_thread, "system-async-mark", 1, 1, 0,
"use the current thread.")
#define FUNC_NAME s_scm_system_async_mark_for_thread
{
- scm_i_queue_async_cell (scm_cons (proc, SCM_EOL),
+ scm_i_queue_async_cell (scm_cons (proc, SCM_BOOL_F),
(SCM_UNBNDP (thread)
? scm_root
: scm_i_thread_root (thread)));