… | |
… | |
66 | $Storable::canonical = 1; # reduce rsync transfers |
66 | $Storable::canonical = 1; # reduce rsync transfers |
67 | Coro::State::cctx_stacksize 256000; # 1-2MB stack, for deep recursions in maze generator |
67 | Coro::State::cctx_stacksize 256000; # 1-2MB stack, for deep recursions in maze generator |
68 | |
68 | |
69 | $Coro::main->prio (Coro::PRIO_MAX); # run main coroutine ("the server") with very high priority |
69 | $Coro::main->prio (Coro::PRIO_MAX); # run main coroutine ("the server") with very high priority |
70 | |
70 | |
71 | { |
71 | # make sure c-lzf reinitialises itself |
72 | # very ugly, but ensure we acquire the storable lock |
|
|
73 | |
|
|
74 | sub net_mstore { |
|
|
75 | my $guard = Coro::Storable::guard; |
|
|
76 | &Storable::net_mstore |
|
|
77 | } |
|
|
78 | |
|
|
79 | sub mretrieve { |
|
|
80 | my $guard = Coro::Storable::guard; |
|
|
81 | &Storable::mretrieve |
|
|
82 | } |
|
|
83 | |
|
|
84 | Compress::LZF::set_serializer "Coro::Storable", "cf::net_mstore", "cf::mretrieve"; |
72 | Compress::LZF::set_serializer "Storable", "Storable::net_mstore", "Storable::mretrieve"; |
85 | Compress::LZF::sfreeze_cr { }; # prime Compress::LZF so it does not use require later |
73 | Compress::LZF::sfreeze_cr { }; # prime Compress::LZF so it does not use require later |
86 | } |
|
|
87 | |
74 | |
88 | sub WF_AUTOCANCEL () { 1 } # automatically cancel this watcher on reload |
75 | sub WF_AUTOCANCEL () { 1 } # automatically cancel this watcher on reload |
89 | |
76 | |
90 | our %COMMAND = (); |
77 | our %COMMAND = (); |
91 | our %COMMAND_TIME = (); |
78 | our %COMMAND_TIME = (); |