pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.168 2003/04/01 14:22:20 grubba Exp $"); + RCSID("$Id: threads.c,v 1.169 2003/05/07 21:01:03 mast Exp $");      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "mapping.h"   #include "object.h"   #include "pike_macros.h"
pike.git/src/threads.c:26: Inside #if defined(HAVE_SYS_PRCTL_H)
     #ifdef HAVE_SYS_PRCTL_H   #include <sys/prctl.h>   #endif /* HAVE_SYS_PRCTL_H */      PMOD_EXPORT int live_threads = 0;   PMOD_EXPORT COND_T live_threads_change;   PMOD_EXPORT COND_T threads_disabled_change;   PMOD_EXPORT size_t thread_stack_size=1024 * 1204;    + PMOD_EXPORT void thread_low_error (int errcode) + { +  fatal ("Unexpected error from thread function: %d\n", errcode); + } +    #ifdef USE_CLOCK_FOR_SLICES   PMOD_EXPORT clock_t thread_start_clock = 0;   #endif      #ifndef HAVE_PTHREAD_ATFORK   #include "callback.h"   #define PIKE_USE_OWN_ATFORK      static struct callback_list atfork_prepare_callback;   static struct callback_list atfork_parent_callback;
pike.git/src/threads.c:618: Inside #if defined(HAVE_BROKEN_LINUX_THREAD_EUID)
  #endif    setegid(arg.egid);    seteuid(arg.euid);   #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)    if (prctl(PR_SET_DUMPABLE, current) == -1)    fatal ("Didn't expect prctl to go wrong. errno=%d\n", errno);   #endif    }   #endif /* HAVE_BROKEN_LINUX_THREAD_EUID */    -  if((tmp=mt_lock_interpreter())) -  fatal("Failed to lock interpreter, return value=%d, errno=%d\n",tmp, - #ifdef __NT__ -  GetLastError() - #else -  errno - #endif -  ); +  mt_lock_interpreter();       while (threads_disabled) {    THREADS_FPRINTF(1, (stderr,    "new_thread_func(): Threads disabled\n"));    co_wait_interpreter(&threads_disabled_change);    }       SWAP_IN_THREAD(OBJ2THREAD(arg.id)); /* Init struct */    init_interpreter();    Pike_interpreter.thread_id=arg.id;