diff --git a/libguile/ChangeLog b/libguile/ChangeLog index f8a627cf8..38bc30167 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,24 @@ +Mon Apr 28 06:10:14 1997 Gary Houston + + * async.c (scm_sys_tick_async_thunk): commented out. I'm not + sure how this was supposed to work. + (scm_async_click): don't send SCM_TICK_SIGNAL. + (scm_init_async): don't initialize %tick-thunk. + + * the following change doesn't affect the Scheme interface: + gc-thunk is called at the end of garbage collection. however it's + no longer implemented by pretending it's a signal. + + * gc.c (scm_gc_end): don't call scm_take_signal. instead mark the + system async corresponding to scm_gc_thunk. + * async.h: declare scm_gc_async. + * async.c (scm_sys_gc_async_thunk): apply the thunk named by + gc-thunk directly, instead of going through a signal handler. + (scm_gc_async): new variable, points to the GC system-async. + (scm_init_async): save the GC async as scm_gc_async instead + of using system_signal_asyncs. + (scm_gc_vcell): new variable, stores the gc-thunk vcell. + Mon Apr 28 19:14:44 1997 Jim Blandy * Makefile.am (libpath.h, cpp_err_symbols.c, cpp_sig_symbols.c): diff --git a/libguile/async.c b/libguile/async.c index 115cc8c2f..d49755c43 100644 --- a/libguile/async.c +++ b/libguile/async.c @@ -142,7 +142,15 @@ asyncs_pending () return 0; } - +#if 0 +static SCM scm_sys_tick_async_thunk SCM_P ((void)); +static SCM +scm_sys_tick_async_thunk () +{ + scm_deliver_signal (SCM_TICK_SIGNAL); + return SCM_BOOL_F; +} +#endif void scm_async_click () @@ -221,8 +229,10 @@ scm_async_click () } } - if (owe_tick) - scm_async_mark (system_signal_asyncs[SCM_SIG_ORD(SCM_TICK_SIGNAL)]); + /* + if (owe_tick) + scm_async_mark (system_signal_asyncs[SCM_SIG_ORD(SCM_TICK_SIGNAL)]); + */ SCM_DEFER_INTS; if (scm_tick_rate && scm_switch_rate) @@ -564,31 +574,29 @@ scm_sys_alrm_async_thunk () return SCM_BOOL_F; } +/* points to the GC system-async, so that scm_gc_end can find it. */ +SCM scm_gc_async; -static SCM scm_sys_gc_async_thunk SCM_P ((void)); +/* the vcell for gc-thunk. */ +static SCM scm_gc_vcell; +/* the thunk installed in the GC system-async, which is marked at the + end of garbage collection. */ static SCM -scm_sys_gc_async_thunk () +scm_sys_gc_async_thunk (void) { - scm_deliver_signal (SCM_GC_SIGNAL); - return SCM_BOOL_F; + if (SCM_NFALSEP (scm_gc_vcell)) + { + SCM proc = SCM_CDR (scm_gc_vcell); + + if (SCM_NFALSEP (proc) && !SCM_UNBNDP (proc)) + scm_apply (proc, SCM_EOL, SCM_EOL); + } + return SCM_UNSPECIFIED; } - -static SCM scm_sys_tick_async_thunk SCM_P ((void)); - -static SCM -scm_sys_tick_async_thunk () -{ - scm_deliver_signal (SCM_TICK_SIGNAL); - return SCM_BOOL_F; -} - - - - SCM scm_take_signal (n) int n; @@ -636,7 +644,6 @@ scm_mask_signals () - void scm_init_async () { @@ -660,13 +667,16 @@ scm_init_async () a_thunk = scm_make_gsubr ("%segv-thunk", 0, 0, 0, scm_sys_segv_async_thunk); system_signal_asyncs[SCM_SIG_ORD(SCM_SEGV_SIGNAL)] = scm_system_async (a_thunk); - + scm_gc_vcell = scm_sysintern ("gc-thunk", SCM_BOOL_F); a_thunk = scm_make_gsubr ("%gc-thunk", 0, 0, 0, scm_sys_gc_async_thunk); - system_signal_asyncs[SCM_SIG_ORD(SCM_GC_SIGNAL)] = scm_system_async (a_thunk); + scm_gc_async = scm_system_async (a_thunk); /* Clock and PC driven conditions are given highest priority. */ - a_thunk = scm_make_gsubr ("%tick-thunk", 0, 0, 0, scm_sys_tick_async_thunk); - system_signal_asyncs[SCM_SIG_ORD(SCM_TICK_SIGNAL)] = scm_system_async (a_thunk); + /* + a_thunk = scm_make_gsubr ("%tick-thunk", 0, 0, 0, scm_sys_tick_async_thunk); + system_signal_asyncs[SCM_SIG_ORD(SCM_TICK_SIGNAL)] = scm_system_async (a_thunk); + */ + a_thunk = scm_make_gsubr ("%alrm-thunk", 0, 0, 0, scm_sys_alrm_async_thunk); system_signal_asyncs[SCM_SIG_ORD(SCM_ALRM_SIGNAL)] = scm_system_async (a_thunk); diff --git a/libguile/async.h b/libguile/async.h index 217603ba6..80c02401d 100644 --- a/libguile/async.h +++ b/libguile/async.h @@ -50,7 +50,7 @@ extern unsigned int scm_mask_ints; - +extern SCM scm_gc_async; extern void scm_async_click SCM_P ((void)); diff --git a/libguile/gc.c b/libguile/gc.c index 9d434f33e..84d94b83d 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -377,7 +377,7 @@ scm_gc_end () { scm_gc_rt = SCM_INUM (scm_get_internal_run_time ()) - scm_gc_rt; scm_gc_time_taken = scm_gc_time_taken + scm_gc_rt; - scm_take_signal (SCM_GC_SIGNAL); + scm_system_async_mark (scm_gc_async); }