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.450 by root, Mon Sep 22 01:33:09 2008 UTC vs.
Revision 1.451 by root, Mon Sep 22 05:42:41 2008 UTC

81our %EXTCMD = (); 81our %EXTCMD = ();
82our %EXTICMD = (); 82our %EXTICMD = ();
83our %EXT_CORO = (); # coroutines bound to extensions 83our %EXT_CORO = (); # coroutines bound to extensions
84our %EXT_MAP = (); # pluggable maps 84our %EXT_MAP = (); # pluggable maps
85 85
86our $RELOAD; # number of reloads so far 86our $RELOAD; # number of reloads so far, non-zero while in reload
87our @EVENT; 87our @EVENT;
88 88
89our $CONFDIR = confdir; 89our $CONFDIR = confdir;
90our $DATADIR = datadir; 90our $DATADIR = datadir;
91our $LIBDIR = "$DATADIR/ext"; 91our $LIBDIR = "$DATADIR/ext";
341 return;#d# 341 return;#d#
342 }#d# 342 }#d#
343 343
344 # wait for lock, if any 344 # wait for lock, if any
345 while ($LOCK{$key}) { 345 while ($LOCK{$key}) {
346 #local $Coro::current->{desc} = "$Coro::current->{desc} <waiting for lock $key>";
346 push @{ $LOCK{$key} }, $Coro::current; 347 push @{ $LOCK{$key} }, $Coro::current;
347 Coro::schedule; 348 Coro::schedule;
348 } 349 }
349} 350}
350 351
3580 my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH}; 3581 my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH};
3581 for my $name (keys %$leaf_symtab) { 3582 for my $name (keys %$leaf_symtab) {
3582 _gv_clear *{"$pkg$name"}; 3583 _gv_clear *{"$pkg$name"};
3583# use PApp::Util; PApp::Util::sv_dump *{"$pkg$name"}; 3584# use PApp::Util; PApp::Util::sv_dump *{"$pkg$name"};
3584 } 3585 }
3585 warn "cleared package #$pkg\n";#d# 3586 warn "cleared package $pkg\n";#d#
3586} 3587}
3587
3588our $RELOAD; # how many times to reload
3589 3588
3590sub do_reload_perl() { 3589sub do_reload_perl() {
3591 # can/must only be called in main 3590 # can/must only be called in main
3592 if ($Coro::current != $Coro::main) { 3591 if ($Coro::current != $Coro::main) {
3593 warn "can only reload from main coroutine"; 3592 warn "can only reload from main coroutine";
3707 3706
3708sub reload_perl() { 3707sub reload_perl() {
3709 # doing reload synchronously and two reloads happen back-to-back, 3708 # doing reload synchronously and two reloads happen back-to-back,
3710 # coro crashes during coro_state_free->destroy here. 3709 # coro crashes during coro_state_free->destroy here.
3711 3710
3712 $RELOAD_WATCHER ||= EV::timer 0, 0, sub { 3711 $RELOAD_WATCHER ||= EV::timer $TICK * 1.5, 0, sub {
3713 do_reload_perl; 3712 do_reload_perl;
3714 undef $RELOAD_WATCHER; 3713 undef $RELOAD_WATCHER;
3715 }; 3714 };
3716} 3715}
3717 3716

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines