summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/thread.h b/thread.h
index 5c78e7d2a2..656a693b36 100644
--- a/thread.h
+++ b/thread.h
@@ -26,7 +26,11 @@ typedef pthread_t perl_os_thread;
#endif
#ifndef YIELD
-# define YIELD sched_yield()
+# ifdef HAS_PTHREAD_YIELD
+# define YIELD pthread_yield()
+# else
+# define YIELD sched_yield()
+# endif
#endif
#ifndef MUTEX_INIT
@@ -109,15 +113,15 @@ typedef pthread_t perl_os_thread;
#ifndef THR
# ifdef OLD_PTHREADS_API
-struct thread *getTHR _((void));
+struct perl_thread *getTHR _((void));
# define THR getTHR()
# else
-# define THR ((struct thread *) pthread_getspecific(thr_key))
+# define THR ((struct perl_thread *) pthread_getspecific(thr_key))
# endif /* OLD_PTHREADS_API */
#endif /* THR */
#ifndef dTHR
-# define dTHR struct thread *thr = THR
+# define dTHR struct perl_thread *thr = THR
#endif /* dTHR */
#ifndef INIT_THREADS
@@ -134,7 +138,7 @@ struct thread *getTHR _((void));
# define THREAD_RET_CAST(p) ((void *)(p))
#endif /* THREAD_RET */
-struct thread {
+struct perl_thread {
/* The fields that used to be global */
/* Important ones in the first cache line (if alignment is done right) */
SV ** Tstack_sp;
@@ -224,7 +228,7 @@ struct thread {
HV * errhv; /* HV for what was %@ in pp_ctl.c */
perl_mutex mutex; /* For the fields others can change */
U32 tid;
- struct thread *next, *prev; /* Circular linked list of threads */
+ struct perl_thread *next, *prev; /* Circular linked list of threads */
JMPENV Tstart_env; /* Top of top_env longjmp() chain */
#ifdef HAVE_THREAD_INTERN
struct thread_intern i; /* Platform-dependent internals */
@@ -232,7 +236,7 @@ struct thread {
char trailing_nul; /* For the sake of thrsv and oursv */
};
-typedef struct thread *Thread;
+typedef struct perl_thread *Thread;
/* Values and macros for thr->flags */
#define THRf_STATE_MASK 7