mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +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
|
do
|
||||||
{
|
{
|
||||||
SCM c = SCM_CDR (asyncs);
|
SCM c = SCM_CDR (asyncs);
|
||||||
SCM_SETCDR (asyncs, SCM_EOL);
|
SCM_SETCDR (asyncs, SCM_BOOL_F);
|
||||||
scm_call_0 (SCM_CAR (asyncs));
|
scm_call_0 (SCM_CAR (asyncs));
|
||||||
asyncs = c;
|
asyncs = c;
|
||||||
}
|
}
|
||||||
|
@ -204,10 +204,23 @@ SCM_DEFINE (scm_system_async, "system-async", 1, 0, 0,
|
||||||
void
|
void
|
||||||
scm_i_queue_async_cell (SCM c, scm_root_state *root)
|
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);
|
SCM p = root->active_asyncs;
|
||||||
root->active_asyncs = c;
|
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.")
|
"use the current thread.")
|
||||||
#define FUNC_NAME s_scm_system_async_mark_for_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_UNBNDP (thread)
|
||||||
? scm_root
|
? scm_root
|
||||||
: scm_i_thread_root (thread)));
|
: scm_i_thread_root (thread)));
|
||||||
|
|
|
@ -276,7 +276,7 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
|
||||||
handler = close_1 (handler, signum);
|
handler = close_1 (handler, signum);
|
||||||
SCM_VECTOR_SET (*signal_handlers, csig, handler);
|
SCM_VECTOR_SET (*signal_handlers, csig, handler);
|
||||||
SCM_VECTOR_SET (signal_handler_cells, csig,
|
SCM_VECTOR_SET (signal_handler_cells, csig,
|
||||||
scm_cons (handler, SCM_EOL));
|
scm_cons (handler, SCM_BOOL_F));
|
||||||
SCM_VECTOR_SET (signal_handler_threads, csig, thread);
|
SCM_VECTOR_SET (signal_handler_threads, csig, thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue