… | |
… | |
192 | LOG llevError, $msg; |
192 | LOG llevError, $msg; |
193 | }; |
193 | }; |
194 | } |
194 | } |
195 | |
195 | |
196 | $Coro::State::DIEHOOK = sub { |
196 | $Coro::State::DIEHOOK = sub { |
|
|
197 | return unless $^S eq 0; # "eq", not "==" |
|
|
198 | |
|
|
199 | if ($Coro::current == $Coro::main) {#d# |
|
|
200 | warn "DIEHOOK called in main context, Coro bug?\n";#d# |
|
|
201 | return;#d# |
|
|
202 | }#d# |
|
|
203 | |
|
|
204 | # kill coroutine otherwise |
197 | warn Carp::longmess $_[0]; |
205 | warn Carp::longmess $_[0]; |
198 | Coro::terminate; |
206 | Coro::terminate |
199 | }; |
207 | }; |
|
|
208 | |
|
|
209 | $SIG{__DIE__} = sub { }; #d#? |
200 | |
210 | |
201 | @safe::cf::global::ISA = @cf::global::ISA = 'cf::attachable'; |
211 | @safe::cf::global::ISA = @cf::global::ISA = 'cf::attachable'; |
202 | @safe::cf::object::ISA = @cf::object::ISA = 'cf::attachable'; |
212 | @safe::cf::object::ISA = @cf::object::ISA = 'cf::attachable'; |
203 | @safe::cf::player::ISA = @cf::player::ISA = 'cf::attachable'; |
213 | @safe::cf::player::ISA = @cf::player::ISA = 'cf::attachable'; |
204 | @safe::cf::client::ISA = @cf::client::ISA = 'cf::attachable'; |
214 | @safe::cf::client::ISA = @cf::client::ISA = 'cf::attachable'; |
… | |
… | |
3562 | sub reload_perl() { |
3572 | sub reload_perl() { |
3563 | # doing reload synchronously and two reloads happen back-to-back, |
3573 | # doing reload synchronously and two reloads happen back-to-back, |
3564 | # coro crashes during coro_state_free->destroy here. |
3574 | # coro crashes during coro_state_free->destroy here. |
3565 | |
3575 | |
3566 | $RELOAD_WATCHER ||= EV::timer 0, 0, sub { |
3576 | $RELOAD_WATCHER ||= EV::timer 0, 0, sub { |
|
|
3577 | do_reload_perl; |
3567 | undef $RELOAD_WATCHER; |
3578 | undef $RELOAD_WATCHER; |
3568 | do_reload_perl; |
|
|
3569 | }; |
3579 | }; |
3570 | } |
3580 | } |
3571 | |
3581 | |
3572 | register_command "reload" => sub { |
3582 | register_command "reload" => sub { |
3573 | my ($who, $arg) = @_; |
3583 | my ($who, $arg) = @_; |