From 81e81a5cb7c1fc6e41f9db427aacbe5413a8d662 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Fri, 28 Nov 1997 00:50:58 +0000 Subject: [PATCH] * iselect.c (coop_next_runnable_thread, coop_wait_for_runnable_thread): Disable interrupts so that no async is executed before a potential error_revive. --- libguile/ChangeLog | 6 ++++++ libguile/iselect.c | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4798afd85..1eae71978 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +1997-11-28 Mikael Djurfeldt + + * iselect.c (coop_next_runnable_thread, + coop_wait_for_runnable_thread): Disable interrupts so that no + async is executed before a potential error_revive. + 1997-11-27 Mikael Djurfeldt * Makefile.am: Added iselect.c and iselect.h. diff --git a/libguile/iselect.c b/libguile/iselect.c index 0f05bb48f..8b8a87912 100644 --- a/libguile/iselect.c +++ b/libguile/iselect.c @@ -430,6 +430,7 @@ find_thread (int n, struct timeval *now) coop_t * coop_next_runnable_thread () { + coop_t *t; struct timeval now; int n; @@ -437,6 +438,7 @@ coop_next_runnable_thread () if (QEMPTYP (coop_global_sleepq)) return coop_qget (&coop_global_runq); + ++scm_ints_disabled; if (gnfds > 0) n = safe_select (gnfds, &greadfds, &gwritefds, &gexceptfds, &timeout0); else @@ -444,9 +446,13 @@ coop_next_runnable_thread () if (QFIRST (coop_global_sleepq)->timeoutp) { gettimeofday (&now, NULL); - return find_thread (n, &now); + t = find_thread (n, &now); } - return find_thread (n, 0); + else + t = find_thread (n, 0); + if (!--scm_ints_disabled) + SCM_ASYNC_TICK; + return t; } coop_t * @@ -455,6 +461,7 @@ coop_wait_for_runnable_thread_now (struct timeval *now) int n; coop_t *t; + ++scm_ints_disabled; if (gnfds > 0) n = safe_select (gnfds, &greadfds, &gwritefds, &gexceptfds, &timeout0); else @@ -482,6 +489,8 @@ coop_wait_for_runnable_thread_now (struct timeval *now) t = find_thread (n, now); } + if (!--scm_ints_disabled) + SCM_ASYNC_TICK; return t; }