summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1997-11-19 22:10:51 -0800
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-25 14:16:29 +0000
commit52e1cb5ebf5e5a8cd5d3d9673b540b0c0dfe20df (patch)
tree078676a210b97f20bbebc123cfe028728a29a04e /thread.h
parent51dd5992be029393cb3f221313a1a6ec2a76c21a (diff)
downloadperl-52e1cb5ebf5e5a8cd5d3d9673b540b0c0dfe20df.tar.gz
AIX patch (including Configure support for {sched,pthread}_yield,
pthread initial detach state, renaming perl_thread to perl_os_thread and struct thread to struct perl_thread): Subject: Re: _54 on AIX p4raw-id: //depot/perl@290
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