diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-17 16:48:20 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-17 16:48:20 +0000 |
commit | 2954239bd785bd1e3837b70fcb2957307430febf (patch) | |
tree | 19f4533033d54ddf02a83cafc93b68cf88eccb63 /ext | |
parent | b9c62f5bd2be329234f46e9e65cc9ed3b85e615b (diff) | |
download | perl-2954239bd785bd1e3837b70fcb2957307430febf.tar.gz |
syntax errors in Thread::* (from Tom Christiansen)
p4raw-id: //depot/perl@5786
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Thread/Thread/Queue.pm | 8 | ||||
-rw-r--r-- | ext/Thread/Thread/Semaphore.pm | 4 | ||||
-rw-r--r-- | ext/Thread/Thread/Specific.pm | 5 |
3 files changed, 9 insertions, 8 deletions
diff --git a/ext/Thread/Thread/Queue.pm b/ext/Thread/Thread/Queue.pm index 6e2fba8e88..831573c726 100644 --- a/ext/Thread/Thread/Queue.pm +++ b/ext/Thread/Thread/Queue.pm @@ -67,13 +67,13 @@ sub new { return bless [@_], $class; } -sub dequeue : locked, method { +sub dequeue : locked : method { my $q = shift; cond_wait $q until @$q; return shift @$q; } -sub dequeue_nb : locked, method { +sub dequeue_nb : locked : method { my $q = shift; if (@$q) { return shift @$q; @@ -82,12 +82,12 @@ sub dequeue_nb : locked, method { } } -sub enqueue : locked, method { +sub enqueue : locked : method { my $q = shift; push(@$q, @_) and cond_broadcast $q; } -sub pending : locked, method { +sub pending : locked : method { my $q = shift; return scalar(@$q); } diff --git a/ext/Thread/Thread/Semaphore.pm b/ext/Thread/Thread/Semaphore.pm index f50f96c8af..3cd6338d4d 100644 --- a/ext/Thread/Thread/Semaphore.pm +++ b/ext/Thread/Thread/Semaphore.pm @@ -69,14 +69,14 @@ sub new { bless \$val, $class; } -sub down : locked, method { +sub down : locked : method { my $s = shift; my $inc = @_ ? shift : 1; cond_wait $s until $$s >= $inc; $$s -= $inc; } -sub up : locked, method { +sub up : locked : method { my $s = shift; my $inc = @_ ? shift : 1; ($$s += $inc) > 0 and cond_broadcast $s; diff --git a/ext/Thread/Thread/Specific.pm b/ext/Thread/Thread/Specific.pm index da3f9375a7..a6271a4ae4 100644 --- a/ext/Thread/Thread/Specific.pm +++ b/ext/Thread/Thread/Specific.pm @@ -15,12 +15,13 @@ C<key_create> returns a unique thread-specific key. =cut -sub import : locked, method { +sub import : locked : method { require fields; fields::->import(@_); } -sub key_create : locked, method { +sub key_create : locked : method { + our %FIELDS; # suppress "used only once" return ++$FIELDS{__MAX__}; } |