ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.521 by root, Fri Apr 16 23:28:42 2010 UTC vs.
Revision 1.522 by root, Sat Apr 17 02:22:14 2010 UTC

165 165
166our $EMERGENCY_POSITION; 166our $EMERGENCY_POSITION;
167 167
168sub cf::map::normalise; 168sub cf::map::normalise;
169 169
170sub in_main() {
171 $Coro::current == $Coro::main
172}
173
170############################################################################# 174#############################################################################
171 175
172%REFLECT = (); 176%REFLECT = ();
173for (@REFLECT) { 177for (@REFLECT) {
174 my $reflect = JSON::XS::decode_json $_; 178 my $reflect = JSON::XS::decode_json $_;
261$Coro::State::DIEHOOK = sub { 265$Coro::State::DIEHOOK = sub {
262 return unless $^S eq 0; # "eq", not "==" 266 return unless $^S eq 0; # "eq", not "=="
263 267
264 warn Carp::longmess $_[0]; 268 warn Carp::longmess $_[0];
265 269
266 if ($Coro::current == $Coro::main) {#d# 270 if (in_main) {#d#
267 warn "DIEHOOK called in main context, Coro bug?\n";#d# 271 warn "DIEHOOK called in main context, Coro bug?\n";#d#
268 return;#d# 272 return;#d#
269 }#d# 273 }#d#
270 274
271 # kill coroutine otherwise 275 # kill coroutine otherwise
3792 } 3796 }
3793} 3797}
3794 3798
3795sub do_reload_perl() { 3799sub do_reload_perl() {
3796 # can/must only be called in main 3800 # can/must only be called in main
3797 if ($Coro::current != $Coro::main) { 3801 if (in_main) {
3798 warn "can only reload from main coroutine"; 3802 warn "can only reload from main coroutine";
3799 return; 3803 return;
3800 } 3804 }
3801 3805
3802 return if $RELOAD++; 3806 return if $RELOAD++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines