Quick thread speedup
authorDan Sugalski <dan@sidhe.org>
Wed, 16 May 2001 18:05:19 +0000 (14:05 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 17 May 2001 01:41:07 +0000 (01:41 +0000)
Message-Id: <5.1.0.14.0.20010516175826.01afde08@24.8.96.48>

p4raw-id: //depot/perl@10141

thread.h
util.c

index 99269a1..87e8974 100644 (file)
--- a/thread.h
+++ b/thread.h
 #endif /* JOIN */
 
 #ifndef PERL_GET_CONTEXT
-#  define PERL_GET_CONTEXT     pthread_getspecific(PL_thr_key)
+/* True for Tru64 version 4.0 and up as well */
+#  if defined(__ALPHA) && (__VMS_VER >= 70000000)
+#    define PERL_GET_CONTEXT   pthread_unchecked_getspecific_np(PL_thr_key)
+#  else
+#    define PERL_GET_CONTEXT   pthread_getspecific(PL_thr_key)
+#  endif
 #endif
 
 #ifndef PERL_SET_CONTEXT
diff --git a/util.c b/util.c
index 720bcf0..848a61e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3489,10 +3489,14 @@ Perl_get_context(void)
        Perl_croak_nocontext("panic: pthread_getspecific");
     return (void*)t;
 #  else
-#  ifdef I_MACH_CTHREADS
-    return (void*)cthread_data(cthread_self());
-#  else
-    return (void*)pthread_getspecific(PL_thr_key);
+#    ifdef I_MACH_CTHREADS
+      return (void*)cthread_data(cthread_self());
+#    else
+#      if defined(__ALPHA) && (__VMS_VER >= 70000000)
+         return (void*)pthread_unchecked_getspecific_np(PL_thr_key);
+#      else
+         return (void*)pthread_getspecific(PL_thr_key);
+#      endif 
 #  endif
 #  endif
 #else