summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-29 06:01:22 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-29 06:01:22 +0000
commitc44d3fdb45c0c48dcd8af6dc9f4a4166137bf839 (patch)
treeec79e5cbf9765f15fbfee480090143a506a9000d /util.c
parentba869debd80c55cfae8e9d4de0991d62f9efcb9b (diff)
downloadperl-c44d3fdb45c0c48dcd8af6dc9f4a4166137bf839.tar.gz
various shenanigans in change#5342
p4raw-link: @5342 on //depot/perl: ba869debd80c55cfae8e9d4de0991d62f9efcb9b p4raw-id: //depot/perl@5343
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.c b/util.c
index 1202b33d6a..091e162e69 100644
--- a/util.c
+++ b/util.c
@@ -3303,8 +3303,12 @@ 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);
# endif
+# endif
#else
return (void*)NULL;
#endif
@@ -3314,8 +3318,12 @@ void
Perl_set_context(void *t)
{
#if defined(USE_THREADS) || defined(USE_ITHREADS)
+# ifdef I_MACH_CTHREADS
+ cthread_set_data(cthread_self(), t);
+# else
if (pthread_setspecific(PL_thr_key, t))
Perl_croak_nocontext("panic: pthread_setspecific");
+# endif
#endif
}