… | |
… | |
356 | |
356 | |
357 | $coro |
357 | $coro |
358 | } |
358 | } |
359 | |
359 | |
360 | sub write_runtime { |
360 | sub write_runtime { |
|
|
361 | $TICK_WATCHER->is_active or cf::cleanup "mainloop frozen but runtime active", 1; |
|
|
362 | |
361 | my $runtime = cf::localdir . "/runtime"; |
363 | my $runtime = cf::localdir . "/runtime"; |
362 | |
364 | |
363 | my $fh = aio_open "$runtime~", O_WRONLY | O_CREAT, 0644 |
365 | my $fh = aio_open "$runtime~", O_WRONLY | O_CREAT, 0644 |
364 | or return; |
366 | or return; |
365 | |
367 | |
… | |
… | |
2354 | }; |
2356 | }; |
2355 | |
2357 | |
2356 | warn "leave emergency perl save\n"; |
2358 | warn "leave emergency perl save\n"; |
2357 | } |
2359 | } |
2358 | |
2360 | |
|
|
2361 | sub post_cleanup { |
|
|
2362 | my ($make_core) = @_; |
|
|
2363 | |
|
|
2364 | warn Carp::longmess "post_cleanup backtrace" |
|
|
2365 | if $make_core; |
|
|
2366 | } |
|
|
2367 | |
2359 | sub reload() { |
2368 | sub reload() { |
2360 | # can/must only be called in main |
2369 | # can/must only be called in main |
2361 | if ($Coro::current != $Coro::main) { |
2370 | if ($Coro::current != $Coro::main) { |
2362 | warn "can only reload from main coroutine"; |
2371 | warn "can only reload from main coroutine"; |
2363 | return; |
2372 | return; |