Branch: Tag:

2003-05-07

2003-05-07 21:01:24 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 argument to enable error
checking mutexes in the thread library (--with-rtldebug is _not_ required).

Rev: man/pike.1:1.12
Rev: src/acconfig.h:1.80
Rev: src/configure.in:1.500
Rev: src/main.c:1.116
Rev: src/main.h:1.16
Rev: src/threads.c:1.169
Rev: src/threads.h:1.119

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;
33:   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
625:    }   #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,