* async.c, error.h (scm_ints_disabled): Removed.
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Tue, 10 Dec 2002 09:35:06 +0000 (09:35 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Tue, 10 Dec 2002 09:35:06 +0000 (09:35 +0000)
* 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.

libguile/ChangeLog
libguile/__scm.h
libguile/async.c
libguile/error.h
libguile/gc.c
libguile/gdbint.c
libguile/init.c
libguile/root.c

index 0db4632..3cec1a9 100644 (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):
index 3cb6663..187ada5 100644 (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 { \
index d68be47..38e5ca2 100644 (file)
 #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}
  *
index 1f16920..ce7c6ed 100644 (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"
 
 \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;
index 6ad9c4e..9d4d321 100644 (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 ();
index 5a4caeb..5cfe073 100644 (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
index 076b05c..c9dec66 100644 (file)
@@ -442,7 +442,6 @@ scm_init_guile_1 (SCM_STACKITEM *base)
       abort ();
     }
 
-  scm_ints_disabled = 1;
   scm_block_gc = 1;
 
   scm_threads_prehistory ();
index 041875a..ff8be70 100644 (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)