Branch: Tag:

1998-04-27

1998-04-27 22:33:17 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

removed some global variables and generally made things more thread safe

Rev: src/array.c:1.35
Rev: src/encode.c:1.21
Rev: src/fsort.c:1.10
Rev: src/fsort_template.h:1.4

19:   #include "builtin_functions.h"   #include "module_support.h"   #include "fsort.h" + #include "threads.h"    - RCSID("$Id: encode.c,v 1.20 1998/04/24 00:32:08 hubbe Exp $"); + RCSID("$Id: encode.c,v 1.21 1998/04/27 22:33:17 hubbe Exp $");      #ifdef _AIX   #include <net/nh.h>
133:    code_entry(num & 15, num >> 4, data);   }    + #ifdef _REENTRANT + static void do_enable_threads(void) + { +  if(!--threads_disabled) +  co_broadcast(&threads_disabled_change); + } + #endif +    static int encode_type(char *t, struct encode_data *data)   {    char *q=t;
887:    char *dat;    struct program *p;    + #ifdef _REENTRANT +  ONERROR err; +  threads_disabled++; +  SET_ONERROR(err, do_enable_threads, 0); + #endif +     p=low_allocate_program();    debug_malloc_touch(p);    tmp.type=T_PROGRAM;
1045:    }    p->flags |= PROGRAM_FINISHED;    ref_push_program(p); +  + #ifdef _REENTRANT +  UNSET_ONERROR(err); +  if(!--threads_disabled) +  co_broadcast(&threads_disabled_change); + #endif    return;    }