applied suggested fix for xhv_array sizing, with portability tweaks
[p5sagit/p5-mst-13.2.git] / thread.h
index 07604f6..9b75245 100644 (file)
--- a/thread.h
+++ b/thread.h
@@ -4,6 +4,7 @@
 #  include <win32thread.h>
 #else
 
+#ifndef DJGPP
 /* POSIXish threads */
 #ifdef OLD_PTHREADS_API
 #  define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
@@ -22,6 +23,7 @@
 #  define pthread_condattr_default NULL
 #endif /* OLD_PTHREADS_API */
 #endif
+#endif
 
 #ifdef PTHREADS_CREATED_JOINABLE
 #  define ATTR_JOINABLE PTHREAD_CREATE_JOINABLE
 #endif
 
 #ifndef YIELD
-#  ifdef HAS_PTHREAD_YIELD
-#    define YIELD pthread_yield()
-#  else
+#  ifdef HAS_SCHED_YIELD
 #    define YIELD sched_yield()
+#  else
+#    ifdef HAS_PTHREAD_YIELD
+#      define YIELD pthread_yield()
+#    endif
 #  endif
 #endif
 
@@ -222,5 +226,9 @@ typedef struct condpair {
 
 #define THR
 /* Rats: if dTHR is just blank then the subsequent ";" throws an error */
+#ifdef WIN32
+#define dTHR extern int Perl___notused
+#else
 #define dTHR extern int errno
+#endif
 #endif /* USE_THREADS */