diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 0db4632f5..3cec1a9c4 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,20 @@ +2002-12-10 Mikael Djurfeldt + + These changes remove scm_ints_disabled (which hasn't has any + effect in Guile for quite some time). + + * async.c, error.h (scm_ints_disabled): Removed. + + * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1), + root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK, + SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled. + (old_ints): Removed. + + * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive + critical section. + (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and + SCM_ALLOW_INTS. + 2002-12-09 Mikael Djurfeldt * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait): diff --git a/libguile/__scm.h b/libguile/__scm.h index 3cb666398..187ada5a0 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -403,27 +403,6 @@ do { \ scm_async_click (); \ } while (0) -#if (SCM_DEBUG_INTERRUPTS == 1) -#include -#define SCM_CHECK_NOT_DISABLED \ - do { \ - if (scm_ints_disabled) \ - fprintf(stderr, "ints already disabled (at %s:%d)\n", \ - __FILE__, __LINE__); \ - } while (0) - -#define SCM_CHECK_NOT_ENABLED \ - do { \ - if (!scm_ints_disabled) \ - fprintf(stderr, "ints already enabled (at %s:%d)\n", \ - __FILE__, __LINE__); \ - } while (0) - -#else -#define SCM_CHECK_NOT_DISABLED -#define SCM_CHECK_NOT_ENABLED -#endif - /* Anthony Green writes: When the compiler sees... @@ -446,48 +425,13 @@ do { \ #define SCM_FENCE #endif -#define SCM_DEFER_INTS \ -do { \ - SCM_FENCE; \ - SCM_CHECK_NOT_DISABLED; \ - SCM_REC_CRITICAL_SECTION_START (scm_i_defer); \ - SCM_FENCE; \ - scm_ints_disabled = 1; \ - SCM_FENCE; \ -} while (0) +#define SCM_DEFER_INTS SCM_REC_CRITICAL_SECTION_START (scm_i_defer) +#define SCM_ALLOW_INTS SCM_REC_CRITICAL_SECTION_END (scm_i_defer) -#define SCM_ALLOW_INTS \ -do { \ - SCM_FENCE; \ - SCM_CHECK_NOT_ENABLED; \ - SCM_REC_CRITICAL_SECTION_END (scm_i_defer); \ - SCM_FENCE; \ - scm_ints_disabled = 0; \ - SCM_FENCE; \ - SCM_THREAD_SWITCHING_CODE; \ - SCM_FENCE; \ -} while (0) - - -#define SCM_REDEFER_INTS \ -do { \ - SCM_FENCE; \ - SCM_REC_CRITICAL_SECTION_START (scm_i_defer); \ - ++scm_ints_disabled; \ - SCM_FENCE; \ -} while (0) - - -#define SCM_REALLOW_INTS \ -do { \ - SCM_FENCE; \ - SCM_REC_CRITICAL_SECTION_END (scm_i_defer); \ - SCM_FENCE; \ - --scm_ints_disabled; \ - SCM_FENCE; \ -} while (0) +#define SCM_REDEFER_INTS SCM_DEFER_INTS +#define SCM_REALLOW_INTS SCM_ALLOW_INTS #define SCM_TICK \ do { \ diff --git a/libguile/async.c b/libguile/async.c index d68be47f5..38e5ca22f 100644 --- a/libguile/async.c +++ b/libguile/async.c @@ -62,11 +62,6 @@ #include #endif -/* This is not used for anything except checking that DEFER_INTS and - ALLOW_INTS are used properly. - */ -int scm_ints_disabled = 1; - /* {Asynchronous Events} * diff --git a/libguile/error.h b/libguile/error.h index 1f1692024..ce7c6ed16 100644 --- a/libguile/error.h +++ b/libguile/error.h @@ -3,7 +3,7 @@ #ifndef SCM_ERROR_H #define SCM_ERROR_H -/* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,8 +49,6 @@ #include "libguile/__scm.h" -SCM_API int scm_ints_disabled; - SCM_API SCM scm_system_error_key; SCM_API SCM scm_num_overflow_key; SCM_API SCM scm_out_of_range_key; diff --git a/libguile/gc.c b/libguile/gc.c index 6ad9c4ec2..9d4d3216a 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -481,8 +481,6 @@ scm_gc_for_newcell (scm_t_cell_type_statistics *freelist, SCM *free_cells) scm_i_thread_put_to_sleep (); - ++scm_ints_disabled; - *free_cells = scm_i_sweep_some_segments (freelist); if (*free_cells == SCM_EOL && scm_i_gc_grow_heap_p (freelist)) { @@ -521,8 +519,6 @@ scm_gc_for_newcell (scm_t_cell_type_statistics *freelist, SCM *free_cells) cell = *free_cells; - --scm_ints_disabled; - *free_cells = SCM_FREE_CELL_CDR (cell); scm_i_thread_wake_up (); diff --git a/libguile/gdbint.c b/libguile/gdbint.c index 5a4caebe8..5cfe0736c 100644 --- a/libguile/gdbint.c +++ b/libguile/gdbint.c @@ -1,5 +1,5 @@ /* GDB interface for Guile - * Copyright (C) 1996,1997,1999,2000,2001 Free Software Foundation, Inc. + * Copyright (C) 1996,1997,1999,2000,2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -90,7 +90,6 @@ */ #define SCM_BEGIN_FOREIGN_BLOCK \ do { \ - old_ints = scm_ints_disabled; scm_ints_disabled = 1; \ old_gc = scm_block_gc; scm_block_gc = 1; \ scm_print_carefully_p = 1; \ } while (0) @@ -100,7 +99,6 @@ do { \ do { \ scm_print_carefully_p = 0; \ scm_block_gc = old_gc; \ - scm_ints_disabled = old_ints; \ } while (0) @@ -135,7 +133,7 @@ static SCM tok_buf; static int tok_buf_mark_p; static SCM gdb_output_port; -static int old_ints, old_gc; +static int old_gc; static void diff --git a/libguile/init.c b/libguile/init.c index 076b05cad..c9dec664b 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -442,7 +442,6 @@ scm_init_guile_1 (SCM_STACKITEM *base) abort (); } - scm_ints_disabled = 1; scm_block_gc = 1; scm_threads_prehistory (); diff --git a/libguile/root.c b/libguile/root.c index 041875a42..ff8be7094 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -234,7 +234,6 @@ scm_internal_cwdr (scm_t_catch_body body, void *body_data, scm_t_catch_handler handler, void *handler_data, SCM_STACKITEM *stack_start) { - int old_ints_disabled = scm_ints_disabled; SCM old_rootcont, old_winds; struct cwdr_handler_data my_handler_data; SCM answer; @@ -286,7 +285,6 @@ scm_internal_cwdr (scm_t_catch_body body, void *body_data, #endif scm_rootcont = old_rootcont; SCM_REALLOW_INTS; - scm_ints_disabled = old_ints_disabled; /* Now run the real handler iff the body did a throw. */ if (my_handler_data.run_handler)