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

Comparing Coro-MP/MP.pm (file contents):
Revision 1.15 by root, Wed Sep 26 18:33:41 2012 UTC vs.
Revision 1.16 by root, Wed Sep 26 18:34:02 2012 UTC

90 my ($port, $threadcb) = @_; 90 my ($port, $threadcb) = @_;
91 91
92 my $coro = async_pool { 92 my $coro = async_pool {
93 # we do it inside the thread, because this hopefully gives us the correct $SELF, 93 # we do it inside the thread, because this hopefully gives us the correct $SELF,
94 # as $SELF should not be localised when threads are switched. 94 # as $SELF should not be localised when threads are switched.
95 $coro->swap_sv (\$SELF, \$port); 95 $Coro::current->swap_sv (\$SELF, \$port);
96 eval { $threadcb->() }; 96 eval { $threadcb->() };
97 kil $SELF, die => $@ if $@; 97 kil $SELF, die => $@ if $@;
98 }; 98 };
99 99
100 # killing the port cancels the coro 100 # killing the port cancels the coro

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines