summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xext/threads/threads.xs14
-rw-r--r--handy.h6
-rw-r--r--hints/os390.sh8
-rw-r--r--thread.h12
4 files changed, 33 insertions, 7 deletions
diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs
index a12c1a8782..83f9e89dfe 100755
--- a/ext/threads/threads.xs
+++ b/ext/threads/threads.xs
@@ -350,13 +350,21 @@ ithread *
SV_to_ithread(pTHX_ SV *sv)
{
ithread *thread;
+#ifdef OEMVS
+ void *ptr;
+#endif
if (SvROK(sv))
{
thread = INT2PTR(ithread*, SvIV(SvRV(sv)));
}
else
{
+#ifdef OEMVS
+ PERL_THREAD_GETSPECIFIC(self_key,ptr);
+ thread = (ithread *) ptr;
+#else
PERL_THREAD_GETSPECIFIC(self_key,thread);
+#endif
}
return thread;
}
@@ -515,7 +523,13 @@ SV*
Perl_ithread_self (pTHX_ SV *obj, char* Class)
{
ithread *thread;
+#ifdef OEMVS
+ void *ptr;
+ PERL_THREAD_GETSPECIFIC(self_key,ptr);
+ thread = (ithread *) ptr;
+#else
PERL_THREAD_GETSPECIFIC(self_key,thread);
+#endif
return ithread_to_SV(aTHX_ obj, thread, Class, TRUE);
}
diff --git a/handy.h b/handy.h
index 9bee70b51f..6936c20df0 100644
--- a/handy.h
+++ b/handy.h
@@ -502,7 +502,11 @@ Converts the specified character to lowercase.
#define isBLANK_LC_utf8(c) isBLANK(c) /* could be wrong */
#ifdef EBCDIC
-# define toCTRL(c) Perl_ebcdic_control(c)
+# ifdef PERL_IMPLICIT_CONTEXT
+# define toCTRL(c) Perl_ebcdic_control(aTHX_ c)
+# else
+# define toCTRL Perl_ebcdic_control
+# endif
#else
/* This conversion works both ways, strangely enough. */
# define toCTRL(c) (toUPPER(c) ^ 64)
diff --git a/hints/os390.sh b/hints/os390.sh
index 422600fe13..0873dfc83d 100644
--- a/hints/os390.sh
+++ b/hints/os390.sh
@@ -123,14 +123,20 @@ case "$ldlibpthname" in
'') ldlibpthname=LIBPATH ;;
esac
+# The folowing should always be used
+d_oldpthreads='define'
+
# Header files to include.
-# You can override these with Configure -Ui_time -Ui_systime.
+# You can override these with Configure -Ui_time -Ui_systime -Dd_pthread_atfork.
case "$i_time" in
'') i_time='define' ;;
esac
case "$i_systime" in
'') i_systime='define' ;;
esac
+case "$d_pthread_atfork" in
+'') d_pthread_atfork='undef' ;;
+esac
case "$d_pthread_atfork" in
'') d_pthread_atfork='undef' ;;
esac
diff --git a/thread.h b/thread.h
index 3f7b2df540..af46690a4b 100644
--- a/thread.h
+++ b/thread.h
@@ -40,6 +40,12 @@
# ifdef __OPEN_VM
# define pthread_addr_t void *
# endif
+# ifdef OEMVS
+# define pthread_addr_t void *
+# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
+# define pthread_create(t,a,s,d) pthread_create(t,&(a),s,d)
+# define pthread_keycreate pthread_key_create
+# endif
# ifdef VMS
# define pthread_attr_init(a) pthread_attr_create(a)
# define PTHREAD_ATTR_SETDETACHSTATE(a,s) pthread_setdetach_np(a,s)
@@ -57,7 +63,7 @@
# define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
# endif
-# if defined(DJGPP) || defined(__OPEN_VM)
+# if defined(DJGPP) || defined(__OPEN_VM) || defined(OEMVS)
# define PTHREAD_ATTR_SETDETACHSTATE(a,s) pthread_attr_setdetachstate(a,&(s))
# define YIELD pthread_yield(NULL)
# endif
@@ -273,11 +279,7 @@
#ifdef HAS_PTHREAD_UNCHECKED_GETSPECIFIC_NP
# define PTHREAD_GETSPECIFIC(key) pthread_unchecked_getspecific_np(key)
#else
-# ifdef OEMVS
-# define PTHREAD_GETSPECIFIC(key) pthread_getspecific_d8_np(key)
-# else
# define PTHREAD_GETSPECIFIC(key) pthread_getspecific(key)
-# endif
#endif
#ifndef PERL_GET_CONTEXT