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.81 by root, Tue Nov 18 23:20:41 2008 UTC vs.
Revision 1.82 by root, Wed Nov 19 11:11:10 2008 UTC

68guaranteed to succeed without blocking, until the next coroutine switch 68guaranteed to succeed without blocking, until the next coroutine switch
69(C<cede> etc.). 69(C<cede> etc.).
70 70
71Note that using C<wait> is much less efficient than using C<down>, so try 71Note that using C<wait> is much less efficient than using C<down>, so try
72to prefer C<down> whenever possible. 72to prefer C<down> whenever possible.
73
74=item $sem->wait ($callback)
75
76If you pass a callback argument to C<wait>, it will not wait, but
77immediately return. The callback will be called as soon as the semaphore
78becomes available (which might be instantly), and gets passed the
79semaphore as first argument.
80
81The callback might C<down> the semaphore exactly once, might wake up other
82coroutines, but is I<NOT> allowed to block (switch to other coroutines).
83
84This is considered a rather experimental interface, and is subject to
85change.
73 86
74=cut 87=cut
75 88
76#=item $status = $sem->timed_down ($timeout) 89#=item $status = $sem->timed_down ($timeout)
77# 90#

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines