Branch: Tag:

2003-04-03

2003-04-03 16:58:36 by Martin Stjernholm <mast@lysator.liu.se>

Backported from 7.5, although slightly less strict: Better checking of error
return codes from various thread functions. Added dT to enable error
checking mutexes in the thread library (--with-rtldebug is _not_ required).

Rev: CHANGES:1.85
Rev: man/pike.1:1.17
Rev: src/acconfig.h:1.111
Rev: src/aclocal.m4:1.58
Rev: src/configure.in:1.662
Rev: src/main.c:1.160
Rev: src/main.h:1.21
Rev: src/pike_threadlib.h:1.26
Rev: src/threads.c:1.197

2:   || 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;
42:   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;   
705:    }   #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;