diff options
Diffstat (limited to 'contrib/perl5/ext/Thread')
-rw-r--r-- | contrib/perl5/ext/Thread/Thread.pm | 11 | ||||
-rw-r--r-- | contrib/perl5/ext/Thread/Thread.xs | 14 |
2 files changed, 19 insertions, 6 deletions
diff --git a/contrib/perl5/ext/Thread/Thread.pm b/contrib/perl5/ext/Thread/Thread.pm index 00cba8a..23f9fe5 100644 --- a/contrib/perl5/ext/Thread/Thread.pm +++ b/contrib/perl5/ext/Thread/Thread.pm @@ -12,6 +12,15 @@ $VERSION = "1.0"; Thread - manipulate threads in Perl (EXPERIMENTAL, subject to change) +=head1 CAVEAT + +The Thread extension requires Perl to be built in a particular way to +enable the older 5.005 threading model. Just to confuse matters, there +is an alternate threading model known as "ithreads" that does NOT +support this extension. If you are using a binary distribution such +as ActivePerl that is built with ithreads support, this extension CANNOT +be used. + =head1 SYNOPSIS use Thread; @@ -130,7 +139,7 @@ signal is discarded. =item cond_broadcast VARIABLE -The C<cond_broadcast> function works similarly to C<cond_wait>. +The C<cond_broadcast> function works similarly to C<cond_signal>. C<cond_broadcast>, though, will unblock B<all> the threads that are blocked in a C<cond_wait> on the locked variable, rather than only one. diff --git a/contrib/perl5/ext/Thread/Thread.xs b/contrib/perl5/ext/Thread/Thread.xs index 4b5e6db..15e2aa2 100644 --- a/contrib/perl5/ext/Thread/Thread.xs +++ b/contrib/perl5/ext/Thread/Thread.xs @@ -21,7 +21,7 @@ static int sig_pipe[2]; #endif static void -remove_thread(pTHX_ struct perl_thread *t) +remove_thread(pTHX_ Thread t) { #ifdef USE_THREADS DEBUG_S(WITH_THR(PerlIO_printf(Perl_debug_log, @@ -82,7 +82,7 @@ threadstart(void *arg) #else Thread thr = (Thread) arg; LOGOP myop; - djSP; + dSP; I32 oldmark = TOPMARK; I32 oldscope = PL_scopestack_ix; I32 retval; @@ -98,7 +98,6 @@ threadstart(void *arg) DEBUG_S(PerlIO_printf(Perl_debug_log, "new thread %p waiting to start\n", thr)); - /* Don't call *anything* requiring dTHR until after PERL_SET_THX() */ /* * Wait until our creator releases us. If we didn't do this, then * it would be potentially possible for out thread to carry on and @@ -116,7 +115,6 @@ threadstart(void *arg) */ PERL_SET_THX(thr); - /* Only now can we use SvPEEK (which calls sv_newmortal which does dTHR) */ DEBUG_S(PerlIO_printf(Perl_debug_log, "new thread %p starting at %s\n", thr, SvPEEK(TOPs))); @@ -323,7 +321,13 @@ newthread (pTHX_ SV *startsv, AV *initargs, char *classname) return sv; #else - croak("No threads in this perl"); +# ifdef USE_ITHREADS + croak("This perl was built for \"ithreads\", which currently does not support Thread.pm.\n" + "Run \"perldoc Thread\" for more information"); +# else + croak("This perl was not built with support for 5.005-style threads.\n" + "Run \"perldoc Thread\" for more information"); +# endif return &PL_sv_undef; #endif } |