Branch: Tag:

1996-10-03

1996-10-03 23:44:19 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

threads added

Rev: src/Makefile.src:1.9
Rev: src/backend.c:1.3
Rev: src/builtin_functions.c:1.6
Rev: src/configure.in:1.6
Rev: src/constants.c:1.3
Rev: src/error.c:1.4
Rev: src/error.h:1.3
Rev: src/interpret.c:1.5
Rev: src/interpret.h:1.3
Rev: src/machine.h.in:1.5
Rev: src/main.c:1.5
Rev: src/modules/files/configure.in:1.6
Rev: src/modules/files/efuns.c:1.3
Rev: src/modules/files/file.c:1.7
Rev: src/modules/files/file_machine.h.in:1.3
Rev: src/modules/files/socket.c:1.3
Rev: src/modules/gdbmmod/gdbmmod.c:1.2
Rev: src/modules/readlinemod/readlinemod.c:1.3
Rev: src/modules/spider/configure.in:1.4
Rev: src/modules/spider/spider.c:1.10
Rev: src/program.c:1.2
Rev: src/threads.c:1.1
Rev: src/threads.h:1.1

24:   #include "builtin_functions.h"   #include "signal_handler.h"   #include "gc.h" + #include "threads.h"      #ifdef HAVE_MMAP   #ifdef HAVE_SYS_TYPES_H
84:      #define MMALLOC(X,Y) (Y *)mmap(0,X*sizeof(Y),PROT_READ|PROT_WRITE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, fd, 0)    +  evaluator_stack_malloced=0; +  mark_stack_malloced=0;    evaluator_stack=MMALLOC(stack_size,struct svalue);    mark_stack=MMALLOC(stack_size, struct svalue *);   
91:       if((char *)MAP_FAILED == (char *)evaluator_stack) evaluator_stack=0;    if((char *)MAP_FAILED == (char *)mark_stack) mark_stack=0; -  + #else +  evaluator_stack=0; +  mark_stack=0;   #endif -  +     if(!evaluator_stack)    { -  evaluator_stack=(struct svalue *)malloc(stack_size*sizeof(struct svalue)); +  evaluator_stack=(struct svalue *)xalloc(stack_size*sizeof(struct svalue));    evaluator_stack_malloced=1;    }       if(!mark_stack)    { -  mark_stack=(struct svalue **)malloc(stack_size*sizeof(struct svalue *)); +  mark_stack=(struct svalue **)xalloc(stack_size*sizeof(struct svalue *));    mark_stack_malloced=1;    }       sp=evaluator_stack;    mark_sp=mark_stack; -  +  fp=0;   }      void check_stack(INT32 size)
291:    */   void check_threads_etc()   { +  THREADS_ALLOW(); +  +  /* Allow other threads to run */ +  +  THREADS_DISALLOW(); +     check_signals();    if(objects_to_destruct) destruct_objects_to_destruct();    CHECK_FOR_GC();
437:       again:   #ifdef DEBUG + #ifdef _REENTRANT +  if(!mt_trylock(& interpreter_lock)) +  fatal("Interpreter running unlocked!\n"); + #endif +     sp[0].type=99; /* an invalid type */    sp[1].type=99;    sp[2].type=99;