Branch: Tag:

2000-04-23

2000-04-23 03:01:26 by Martin Stjernholm <mast@lysator.liu.se>

GC fixes. Made the gc quite a bit more whiny when -d is used.

Rev: src/array.c:1.68
Rev: src/array.h:1.19
Rev: src/gc.c:1.79
Rev: src/gc.h:1.38
Rev: src/mapping.c:1.79
Rev: src/mapping.h:1.24
Rev: src/multiset.c:1.20
Rev: src/multiset.h:1.10
Rev: src/object.c:1.120
Rev: src/object.h:1.45
Rev: src/program.c:1.232
Rev: src/program.h:1.87
Rev: src/svalue.c:1.72
Rev: src/threads.h:1.89

1:   /* -  * $Id: threads.h,v 1.88 2000/04/21 23:07:10 hubbe Exp $ +  * $Id: threads.h,v 1.89 2000/04/23 03:01:26 mast Exp $    */   #ifndef THREADS_H   #define THREADS_H
57:   extern size_t thread_stack_size;   extern struct object *thread_id;    - /* Used by debug code. Avoid pulling in gc.h only for this. */ - extern int Pike_in_gc; -  +    #define DEFINE_MUTEX(X) PIKE_MUTEX_T X      
504:   #define THREADS_ALLOW() do { \    struct thread_state *_tmp=OBJ2THREAD(thread_id); \    DO_IF_DEBUG({ \ +  extern int Pike_in_gc; \    if(thread_for_id(th_self()) != thread_id) \    fatal("thread_for_id() (or thread_id) failed! %p != %p\n",thread_for_id(th_self()),thread_id); \ -  if (Pike_in_gc >=100 && Pike_in_gc <300) \ +  if (Pike_in_gc >= 100 && Pike_in_gc != 300 && Pike_in_gc != 500) \    fatal("Threads allowed during garbage collection.\n"); \    }) \    if(num_threads > 1 && !threads_disabled) { \
539:   #define THREADS_ALLOW_UID() do { \    struct thread_state *_tmp_uid=OBJ2THREAD(thread_id); \    DO_IF_DEBUG({ \ +  extern int Pike_in_gc; \    if(thread_for_id(th_self()) != thread_id) \    fatal("thread_for_id() (or thread_id) failed! %p != %p\n",thread_for_id(th_self()),thread_id); \ -  if (Pike_in_gc >=100 && Pike_in_gc <300) \ +  if (Pike_in_gc >= 100 && Pike_in_gc != 300 && Pike_in_gc != 500) \    fatal("Threads allowed during garbage collection.\n"); \    }) \    if(num_threads > 1 && !threads_disabled) { \