mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
* 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.
This commit is contained in:
parent
5e405a6055
commit
f6b44bd99f
2 changed files with 19 additions and 6 deletions
|
@ -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)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue