*** pthread_ex.c.orig 2007-08-28 06:50:53.000000000 +0200 --- pthread_ex.c 2007-08-28 06:49:02.000000000 +0200 *************** *** 20,32 **** /* callback: context fetching */ static ex_ctx_t *pthread_ex_ctx(void) { ! return (ex_ctx_t *) ! pthread_getspecific(pthread_ex_ctx_key); } /* callback: termination */ static void pthread_ex_terminate(ex_t *e) { pthread_exit(e->ex_value); } --- 20,41 ---- /* callback: context fetching */ static ex_ctx_t *pthread_ex_ctx(void) { ! ex_ctx_t* ctx = (ex_ctx_t *)pthread_getspecific(pthread_ex_ctx_key); ! ! if (!ctx) ! return __ex_ctx_default(); ! ! return ctx; } /* callback: termination */ static void pthread_ex_terminate(ex_t *e) { + ex_ctx_t* ctx = (ex_ctx_t *)pthread_getspecific(pthread_ex_ctx_key); + + if (!ctx) + __ex_terminate_default(e); + pthread_exit(e->ex_value); }