From 1ceead47c4e4bbc734a19f51a14502eabfa6bac6 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 27 Oct 2002 20:16:18 +0000 Subject: [PATCH] * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of active_asyncs. * root.h (scm_root_state): Added pending_asyncs and signal_asyncs fields. * root.c (root_mark): Mark them. (make_root): Initialize them. --- libguile/__scm.h | 2 +- libguile/root.c | 3 +++ libguile/root.h | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libguile/__scm.h b/libguile/__scm.h index 700ff9d7f..c7f2b1d58 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -408,7 +408,7 @@ typedef long SCM_STACKITEM; #define SCM_ASYNC_TICK /*fixme* should change names */ \ do { \ - if (scm_root->active_asyncs != SCM_EOL) \ + if (scm_root->pending_asyncs) \ scm_async_click (); \ } while (0) diff --git a/libguile/root.c b/libguile/root.c index 3017a16c0..7c5a26c93 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -81,6 +81,7 @@ root_mark (SCM root) /* No need to gc mark def_loadp */ scm_gc_mark (s->fluids); scm_gc_mark (s->active_asyncs); + scm_gc_mark (s->signal_asyncs); return SCM_ROOT_STATE (root) -> parent; } @@ -131,7 +132,9 @@ scm_make_root (SCM parent) } root_state->active_asyncs = SCM_EOL; + root_state->signal_asyncs = SCM_EOL; root_state->block_asyncs = 0; + root_state->pending_asyncs = 1; SCM_REDEFER_INTS; SCM_NEWSMOB (root, scm_tc16_root, root_state); diff --git a/libguile/root.h b/libguile/root.h index 6d7658d9e..2795b171e 100644 --- a/libguile/root.h +++ b/libguile/root.h @@ -109,8 +109,12 @@ typedef struct scm_root_state SCM active_asyncs; /* The thunks to be run at the next safe point */ + SCM signal_asyncs; /* The pre-queued cells for signal handlers. + */ unsigned int block_asyncs; /* Non-zero means that asyncs should not be run. */ + unsigned int pending_asyncs; /* Non-zero means that asyncs might be pending. + */ } scm_root_state; #define scm_stack_base (scm_root->stack_base) -- 2.20.1