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);
}
my @list = Thread->list; # not available with ithreads
- unlock(...); # not available with the 5.005 threads
-
use Thread 'async';
=head1 DESCRIPTION
=item lock VARIABLE
-C<lock> places a lock on a variable until the lock goes out of scope
-(with ithreads you can also explicitly unlock()).
+C<lock> places a lock on a variable until the lock goes out of scope.
If the variable is locked by another thread, the C<lock> call will
block until it's available. C<lock> is recursive, so multiple calls
*{"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"};
}
unimplement(qw(done flags));
} elsif ($othreads) {
XSLoader::load 'Thread';
- unimplement(qw(unlock));
} else {
require Carp;
Carp::croak("This Perl has neither ithreads nor 5005threads");