… | |
… | |
687 | |
687 | |
688 | while ($busy) { |
688 | while ($busy) { |
689 | if (Coro::nready) { |
689 | if (Coro::nready) { |
690 | Coro::cede_notself; |
690 | Coro::cede_notself; |
691 | } else { |
691 | } else { |
692 | EV::loop EV::LOOP_ONESHOT; |
692 | EV::run EV::RUN_ONESHOT; |
693 | } |
693 | } |
694 | } |
694 | } |
695 | |
695 | |
696 | my $time = AE::time - $time; |
696 | my $time = AE::time - $time; |
697 | |
697 | |
… | |
… | |
3915 | seek $fh, 0, 0; |
3915 | seek $fh, 0, 0; |
3916 | print $fh $$; |
3916 | print $fh $$; |
3917 | } |
3917 | } |
3918 | |
3918 | |
3919 | sub main_loop { |
3919 | sub main_loop { |
3920 | trace "EV::loop starting\n"; |
3920 | trace "EV::run starting\n"; |
3921 | if (1) { |
3921 | if (1) { |
3922 | EV::loop; |
3922 | EV::run; |
3923 | } |
3923 | } |
3924 | trace "EV::loop returned\n"; |
3924 | trace "EV::run returned\n"; |
3925 | goto &main_loop unless $REALLY_UNLOOP; |
3925 | goto &main_loop unless $REALLY_UNLOOP; |
3926 | } |
3926 | } |
3927 | |
3927 | |
3928 | sub main { |
3928 | sub main { |
3929 | cf::init_globals; # initialise logging |
3929 | cf::init_globals; # initialise logging |
… | |
… | |
3938 | # we must not ever block the main coroutine |
3938 | # we must not ever block the main coroutine |
3939 | $Coro::idle = sub { |
3939 | $Coro::idle = sub { |
3940 | Carp::cluck "FATAL: Coro::idle was called, major BUG, use cf::sync_job!\n";#d# |
3940 | Carp::cluck "FATAL: Coro::idle was called, major BUG, use cf::sync_job!\n";#d# |
3941 | (async { |
3941 | (async { |
3942 | $Coro::current->{desc} = "IDLE BUG HANDLER"; |
3942 | $Coro::current->{desc} = "IDLE BUG HANDLER"; |
3943 | EV::loop EV::LOOP_ONESHOT; |
3943 | EV::run EV::RUN_ONESHOT; |
3944 | })->prio (Coro::PRIO_MAX); |
3944 | })->prio (Coro::PRIO_MAX); |
3945 | }; |
3945 | }; |
3946 | |
3946 | |
3947 | evthread_start IO::AIO::poll_fileno; |
3947 | evthread_start IO::AIO::poll_fileno; |
3948 | |
3948 | |