X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=thread.h;h=309d388cb36b2be2223dc1b7a820352dff6f71a8;hb=d1777648259a97c52b380dc00e781956751e1d6c;hp=b14907abd3ebd07c8b66e2a643ecccf511969826;hpb=8b8b35abf0ac836d99804d38380d3c236b12c28e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/thread.h b/thread.h index b14907a..309d388 100644 --- a/thread.h +++ b/thread.h @@ -1,4 +1,4 @@ -#if defined(USE_THREADS) || defined(USE_ITHREADS) +#if defined(USE_5005THREADS) || defined(USE_ITHREADS) #if defined(VMS) #include @@ -7,6 +7,9 @@ #ifdef WIN32 # include #else +#ifdef NETWARE +# include +#else # ifdef OLD_PTHREADS_API /* Here be dragons. */ # define DETACH(t) \ STMT_START { \ @@ -54,6 +57,7 @@ # define pthread_mutexattr_default NULL # define pthread_condattr_default NULL # endif +#endif /* NETWARE */ #endif #ifndef PTHREAD_CREATE @@ -252,7 +256,7 @@ /* Use an unchecked fetch of thread-specific data instead of a checked one. * It would fail if the key were bogus, but if the key were bogus then * Really Bad Things would be happening anyway. --dan */ -#if (defined(__ALPHA) && (__VMS_VER >= 70000000)) || +#if (defined(__ALPHA) && (__VMS_VER >= 70000000)) || \ (defined(__alpha) && defined(__osf__)) /* Available only on >= 4.0 */ # define HAS_PTHREAD_UNCHECKED_GETSPECIFIC_NP /* Configure test needed */ #endif @@ -298,12 +302,22 @@ } STMT_END #endif +#ifndef PTHREAD_ATFORK +# ifdef HAS_PTHREAD_ATFORK +# define PTHREAD_ATFORK(prepare,parent,child) \ + pthread_atfork(prepare,parent,child) +# else +# define PTHREAD_ATFORK(prepare,parent,child) \ + NOOP +# endif +#endif + #ifndef THREAD_RET_TYPE # define THREAD_RET_TYPE void * # define THREAD_RET_CAST(p) ((void *)(p)) #endif /* THREAD_RET */ -#if defined(USE_THREADS) +#if defined(USE_5005THREADS) /* Accessor for per-thread SVs */ # define THREADSV(i) (thr->threadsvp[i]) @@ -357,8 +371,8 @@ typedef struct condpair { #define MgCONDP(mg) (&((condpair_t *)(mg->mg_ptr))->cond) #define MgOWNER(mg) ((condpair_t *)(mg->mg_ptr))->owner -#endif /* USE_THREADS */ -#endif /* USE_THREADS || USE_ITHREADS */ +#endif /* USE_5005THREADS */ +#endif /* USE_5005THREADS || USE_ITHREADS */ #ifndef MUTEX_LOCK # define MUTEX_LOCK(m)