… | |
… | |
273 | warn $@ if $@; |
273 | warn $@ if $@; |
274 | undef $busy; |
274 | undef $busy; |
275 | })->prio (Coro::PRIO_MAX); |
275 | })->prio (Coro::PRIO_MAX); |
276 | |
276 | |
277 | while ($busy) { |
277 | while ($busy) { |
278 | unless (Coro::cede) { |
278 | Coro::cede or Event::one_event; |
279 | Coro::nready ? Event::one_event 0 : Event::one_event; |
|
|
280 | Coro::cede_notself unless Coro::cede; |
|
|
281 | } |
|
|
282 | } |
279 | } |
283 | |
280 | |
284 | wantarray ? @res : $res[0] |
281 | wantarray ? @res : $res[0] |
285 | } else { |
282 | } else { |
286 | # we are in another coroutine, how wonderful, everything just works |
283 | # we are in another coroutine, how wonderful, everything just works |