1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 17:20:29 +02:00

* 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.
This commit is contained in:
Mikael Djurfeldt 2002-12-10 09:35:06 +00:00
parent 06babeccd1
commit c7fabadfe0
8 changed files with 24 additions and 79 deletions

View file

@ -1,3 +1,20 @@
2002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
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 <djurfeldt@nada.kth.se>
* threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):

View file

@ -403,27 +403,6 @@ do { \
scm_async_click (); \
} while (0)
#if (SCM_DEBUG_INTERRUPTS == 1)
#include <stdio.h>
#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 { \

View file

@ -62,11 +62,6 @@
#include <unistd.h>
#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}
*

View file

@ -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;

View file

@ -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 ();

View file

@ -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

View file

@ -442,7 +442,6 @@ scm_init_guile_1 (SCM_STACKITEM *base)
abort ();
}
scm_ints_disabled = 1;
scm_block_gc = 1;
scm_threads_prehistory ();

View file

@ -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)