Remove per-thread `gc_running_p'.
authorLudovic Courtès <ludo@gnu.org>
Wed, 17 Sep 2008 22:04:38 +0000 (00:04 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 17 Sep 2008 22:04:38 +0000 (00:04 +0200)
* libguile/gc.c (scm_gc): Don't use `scm_gc_running_p' as
  an lvalue.

* libguile/gc.h (scm_gc_running_p): Define to 0.

* libguile/threads.h (scm_i_thread)[gc_running_p]: Remove.

libguile/gc.c
libguile/gc.h
libguile/threads.c
libguile/threads.h

index c820428..93d98d4 100644 (file)
@@ -388,7 +388,6 @@ SCM_DEFINE (scm_gc, "gc", 0, 0, 0,
 #define FUNC_NAME s_scm_gc
 {
   scm_i_scm_pthread_mutex_lock (&scm_i_sweep_mutex);
-  scm_gc_running_p = 1;
   scm_i_gc ("call");
   /* njrev: It looks as though other places, e.g. scm_realloc,
      can call scm_i_gc without acquiring the sweep mutex.  Does this
@@ -397,7 +396,6 @@ SCM_DEFINE (scm_gc, "gc", 0, 0, 0,
      (e.g. scm_permobjs above in scm_gc_stats) by a critical section,
      not by the sweep mutex.  Shouldn't all the GC-relevant objects be
      protected in the same way? */
-  scm_gc_running_p = 0;
   scm_i_pthread_mutex_unlock (&scm_i_sweep_mutex);
   scm_c_hook_run (&scm_after_gc_c_hook, 0);
   return SCM_UNSPECIFIED;
index 2591e68..6b3d6a2 100644 (file)
@@ -136,7 +136,7 @@ void scm_i_expensive_validation_check (SCM cell);
 
 SCM_INTERNAL scm_i_pthread_mutex_t scm_i_gc_admin_mutex;
 
-#define scm_gc_running_p (SCM_I_CURRENT_THREAD->gc_running_p)
+#define scm_gc_running_p  0
 SCM_INTERNAL scm_i_pthread_mutex_t scm_i_sweep_mutex;
 
 #ifdef __ia64__
index 0e5c2b1..281ff80 100644 (file)
@@ -457,7 +457,6 @@ guilify_self_1 (SCM_STACKITEM *base)
   /* XXX - check for errors. */
   pipe (t->sleep_pipe);
   scm_i_pthread_mutex_init (&t->admin_mutex, NULL);
-  t->gc_running_p = 0;
   t->current_mark_stack_ptr = NULL;
   t->current_mark_stack_limit = NULL;
   t->canceled = 0;
index 2b8196c..7eee871 100644 (file)
@@ -66,9 +66,6 @@ typedef struct scm_i_thread {
   scm_i_pthread_cond_t sleep_cond;
   int sleep_fd, sleep_pipe[2];
 
-  int gc_running_p;      /* non-zero while this thread does GC or a
-                           sweep. */
-
   /* Information about the Boehm-GC mark stack during the mark phase.  This
      is used by `scm_gc_mark ()'.  */
   void *current_mark_stack_ptr;