--- deliantra/server/lib/cf.pm 2008/04/11 13:59:06 1.416 +++ deliantra/server/lib/cf.pm 2008/04/11 21:09:53 1.418 @@ -1777,6 +1777,9 @@ sub generate_random_map { my ($self, $rmp) = @_; + + my $lock = cf::lock_acquire "generate_random_map"; # the random map generator is NOT reentrant ATM + # mit "rum" bekleckern, nicht $self->_create_random_map ( $rmp->{wallstyle}, $rmp->{wall_name}, $rmp->{floorstyle}, $rmp->{monsterstyle}, @@ -3406,7 +3409,7 @@ } } -sub write_runtime { +sub write_runtime_sync { my $runtime = "$LOCALDIR/runtime"; # first touch the runtime file to show we are still running: @@ -3544,9 +3547,9 @@ warn "entering sync_job"; cf::sync_job { - cf::write_runtime; # external watchdog should not bark + cf::write_runtime_sync; # external watchdog should not bark cf::emergency_save; - cf::write_runtime; # external watchdog should not bark + cf::write_runtime_sync; # external watchdog should not bark warn "syncing database to disk"; BDB::db_env_txn_checkpoint $DB_ENV; @@ -3711,7 +3714,7 @@ $NEXT_RUNTIME_WRITE = List::Util::max $NEXT_RUNTIME_WRITE + 10, $NOW + 5.; Coro::async_pool { $Coro::current->{desc} = "runtime saver"; - write_runtime + write_runtime_sync or warn "ERROR: unable to write runtime file: $!"; }; }