X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FThread.pm;h=c9f05c0526c4cfd1a452da104c9b25269b5bab97;hb=c74ace89800a81a764294e9f6eacc04bbed5a568;hp=7173ac22518242f96e4040e22e3781479788f8d8;hpb=e7b4e24c151b097035e69f04d0511ab4860e86db;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Thread.pm b/lib/Thread.pm index 7173ac2..c9f05c0 100644 --- a/lib/Thread.pm +++ b/lib/Thread.pm @@ -19,7 +19,7 @@ our(@ISA, @EXPORT, @EXPORT_OK); BEGIN { if ($ithreads) { - @EXPORT = qw(cond_wait cond_broadcast cond_signal unlock) + @EXPORT = qw(cond_wait cond_broadcast cond_signal) } elsif ($othreads) { @EXPORT_OK = qw(cond_signal cond_broadcast cond_wait); } @@ -28,7 +28,7 @@ BEGIN { =head1 NAME -Thread - manipulate threads in Perl +Thread - manipulate threads in Perl (for old code only) =head1 CAVEAT @@ -65,7 +65,7 @@ be thought differently. With the ithreads you must explicitly share() variables between the threads. For new code the use of the C module is discouraged and -the direct use use of the C and C modules +the direct use of the C and C modules is encouraged instead. Finally, note that there are many known serious problems with the @@ -107,8 +107,6 @@ use ithreads instead. my @list = Thread->list; # not available with ithreads - unlock(...); # not available with the 5.005 threads - use Thread 'async'; =head1 DESCRIPTION @@ -132,8 +130,7 @@ thread. =item lock VARIABLE -C places a lock on a variable until the lock goes out of scope -(with ithreads you can also explicitly unlock()). +C places a lock on a variable until the lock goes out of scope. If the variable is locked by another thread, the C call will block until it's available. C is recursive, so multiple calls @@ -323,7 +320,7 @@ BEGIN { *{"Thread::$m"} = \&{"threads::$m"}; } require 'threads/shared.pm'; - for my $m (qw(cond_signal cond_broadcast cond_wait unlock)) { + for my $m (qw(cond_signal cond_broadcast cond_wait)) { no strict 'refs'; *{"Thread::$m"} = \&{"threads::shared::${m}_enabled"}; } @@ -331,7 +328,6 @@ BEGIN { unimplement(qw(done flags)); } elsif ($othreads) { XSLoader::load 'Thread'; - unimplement(qw(unlock)); } else { require Carp; Carp::croak("This Perl has neither ithreads nor 5005threads");