pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.54 1998/01/26 20:00:01 hubbe Exp $"); + RCSID("$Id: threads.c,v 1.55 1998/01/30 06:19:51 hubbe Exp $");      int num_threads = 1;   int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "object.h"   #include "pike_macros.h"   #include "callback.h"
pike.git/src/threads.c:136:      struct object *thread_id;   static struct callback *threads_evaluator_callback=0;   int thread_id_result_variable;      MUTEX_T interpreter_lock;   struct program *mutex_key = 0;   struct program *thread_id_prog = 0;   #ifdef POSIX_THREADS   pthread_attr_t pattr; + pthread_attr_t small_pattr;   #endif      struct thread_starter   {    struct object *id;    struct array *args;   };      static void check_threads(struct callback *cb, void *arg, void * arg2)   {
pike.git/src/threads.c:600:   #endif /* POSIX_THREADS */       mt_init( & interpreter_lock);    mt_lock( & interpreter_lock);   #ifdef POSIX_THREADS    pthread_attr_init(&pattr);   #ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE    pthread_attr_setstacksize(&pattr, 2 * 1024 * 1204);   #endif    pthread_attr_setdetachstate(&pattr, PTHREAD_CREATE_DETACHED); +  +  pthread_attr_init(&small_pattr); + #ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE +  pthread_attr_setstacksize(&small_pattr, 32768);   #endif -  +  pthread_attr_setdetachstate(&small_pattr, PTHREAD_CREATE_DETACHED);    -  + #endif +     add_efun("thread_create",f_thread_create,"function(mixed ...:object)",    OPT_SIDE_EFFECT);   #ifdef UNIX_THREADS    add_efun("thread_set_concurrency",f_thread_set_concurrency,    "function(int:void)", OPT_SIDE_EFFECT);   #endif    add_efun("this_thread",f_this_thread,"function(:object)",    OPT_EXTERNAL_DEPEND);       start_new_program();