ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/Semaphore.pm
(Generate patch)

Comparing Coro/Coro/Semaphore.pm (file contents):
Revision 1.89 by root, Mon Mar 16 22:22:12 2009 UTC vs.
Revision 1.90 by root, Sat Mar 21 08:53:20 2009 UTC

137 137
138sub guard { 138sub guard {
139 &down; 139 &down;
140 # double indirection because bless works on the referenced 140 # double indirection because bless works on the referenced
141 # object, not (just) on the reference itself. 141 # object, not (just) on the reference itself.
142 bless \\$_[0], Coro::Semaphore::guard::; 142 bless [$_[0]], Coro::Semaphore::guard::
143} 143}
144 144
145#=item $guard = $sem->timed_guard ($timeout) 145#=item $guard = $sem->timed_guard ($timeout)
146# 146#
147#Like C<guard>, but returns undef if semaphore couldn't be acquired within 147#Like C<guard>, but returns undef if semaphore couldn't be acquired within
152# ? bless \\$_[0], Coro::Semaphore::guard:: 152# ? bless \\$_[0], Coro::Semaphore::guard::
153# : (); 153# : ();
154#} 154#}
155 155
156sub Coro::Semaphore::guard::DESTROY { 156sub Coro::Semaphore::guard::DESTROY {
157 &up(${${$_[0]}}); 157 &up($_[0][0]);
158} 158}
159 159
160=back 160=back
161 161
162=head1 AUTHOR 162=head1 AUTHOR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines