… | |
… | |
845 | Returns true when the condition is "true", i.e. whether C<send> or |
845 | Returns true when the condition is "true", i.e. whether C<send> or |
846 | C<croak> have been called. |
846 | C<croak> have been called. |
847 | |
847 | |
848 | =item $cb = $cv->cb ($cb->($cv)) |
848 | =item $cb = $cv->cb ($cb->($cv)) |
849 | |
849 | |
850 | This is a mutator function that returns the callback set and optionally |
850 | This is a mutator function that returns the callback set (or C<undef> if |
851 | replaces it before doing so. |
851 | not) and optionally replaces it before doing so. |
852 | |
852 | |
853 | The callback will be called when the condition becomes "true", i.e. when |
853 | The callback will be called when the condition becomes "true", i.e. when |
854 | C<send> or C<croak> are called, with the only argument being the |
854 | C<send> or C<croak> are called, with the only argument being the |
855 | condition variable itself. If the condition is already true, the |
855 | condition variable itself. If the condition is already true, the |
856 | callback is called immediately when it is set. Calling C<recv> inside |
856 | callback is called immediately when it is set. Calling C<recv> inside |
857 | the callback or at any later time is guaranteed not to block. |
857 | the callback or at any later time is guaranteed not to block. |
|
|
858 | |
|
|
859 | Additionally, when the callback is invoked, it is also removed from the |
|
|
860 | condvar (reset to C<undef>), so the condvar does not keep a reference to |
|
|
861 | the callback after invocation. |
858 | |
862 | |
859 | =back |
863 | =back |
860 | |
864 | |
861 | =head1 SUPPORTED EVENT LOOPS/BACKENDS |
865 | =head1 SUPPORTED EVENT LOOPS/BACKENDS |
862 | |
866 | |