+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):
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...
#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 { \
#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;
-
\f
/* {Asynchronous Events}
*
#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
#include "libguile/__scm.h"
\f
-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;
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))
{
cell = *free_cells;
- --scm_ints_disabled;
-
*free_cells = SCM_FREE_CELL_CDR (cell);
scm_i_thread_wake_up ();
/* 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
*/
#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)
do { \
scm_print_carefully_p = 0; \
scm_block_gc = old_gc; \
- scm_ints_disabled = old_ints; \
} while (0)
static int tok_buf_mark_p;
static SCM gdb_output_port;
-static int old_ints, old_gc;
+static int old_gc;
static void
abort ();
}
- scm_ints_disabled = 1;
scm_block_gc = 1;
scm_threads_prehistory ();
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;
#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)