pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: threads.c,v 1.196 2003/04/01 14:19:11 grubba Exp $ + || $Id: threads.c,v 1.197 2003/04/03 16:58:36 mast Exp $   */      #include "global.h" - RCSID("$Id: threads.c,v 1.196 2003/04/01 14:19:11 grubba Exp $"); + RCSID("$Id: threads.c,v 1.197 2003/04/03 16:58:36 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:35: 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, disallow_live_threads = 0;   PMOD_EXPORT COND_T live_threads_change;   PMOD_EXPORT COND_T threads_disabled_change;   PMOD_EXPORT size_t thread_stack_size=256 * 1204;    + PMOD_EXPORT void thread_low_error (int errcode) + { +  Pike_fatal ("Unexpected error from thread function: %d\n", errcode); + } +    /* SCO magic... */   int __thread_sys_behavior = 1;      #if !defined(HAVE_PTHREAD_ATFORK) && !defined(th_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:698: 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)    Pike_fatal ("Didn't expect prctl to go wrong. errno=%d\n", errno);   #endif    }   #endif /* HAVE_BROKEN_LINUX_THREAD_EUID */    -  if((tmp=mt_lock_interpreter())) -  Pike_fatal("Failed to lock interpreter, return value=%d, errno=%d\n",tmp, - #ifdef __NT__ -  GetLastError() - #else -  errno - #endif -  ); +  mt_lock_interpreter(); +     SWAP_IN_THREAD(OBJ2THREAD(arg.id)); /* Init struct */    init_interpreter();    Pike_interpreter.thread_id=arg.id;   #ifdef PROFILING    Pike_interpreter.stack_bottom=((char *)&data);   #endif    Pike_interpreter.stack_top=((char *)&data)+ (thread_stack_size-16384) * STACK_DIRECTION;    Pike_interpreter.recoveries = NULL;    SWAP_OUT_THREAD(OBJ2THREAD(Pike_interpreter.thread_id)); /* Init struct */    Pike_interpreter.thread_id=arg.id;