--- deliantra/server/utils/cfutil.in 2007/12/28 12:44:45 1.67 +++ deliantra/server/utils/cfutil.in 2008/12/05 00:52:44 1.70 @@ -14,14 +14,14 @@ my $PNGNQ = "@PNGNQ@"; use Getopt::Long; -use Coro::Event; +use Coro::EV; use AnyEvent; -use YAML::Syck (); +use YAML (); use JSON::XS (); use IO::AIO (); use File::Temp; use Deliantra; -use Coro; +use Coro 5.12; use Coro::AIO; use Coro::Util; use POSIX (); @@ -69,8 +69,8 @@ END { system "rm", "-rf", $TMPDIR } -Event->signal (signal => "INT", cb => sub { exit 1 }); -Event->signal (signal => "TERM", cb => sub { exit 1 }); +my $s_INT = EV::signal INT => sub { exit 1 }; +my $s_TERM = EV::signal TERM => sub { exit 1 }; mkdir $TMPDIR, 0700 or die "$TMPDIR: $!"; @@ -535,7 +535,7 @@ if (my $filter = $meta->{cfutil_filter}) { if ($filter eq "yaml2json") { - $data = JSON::XS::encode_json YAML::Syck::Load $data; + $data = JSON::XS::encode_json YAML::Load $data; } elsif ($filter eq "json2json") { $data = JSON::XS::encode_json JSON::XS->relaxed->utf8->decode ($data); } elsif ($filter eq "perl2json") { @@ -632,9 +632,9 @@ IO::AIO::flush; - $c_res->put (undef) for @a_res; - $c_arc->put (undef) for @a_arc; - $c_trs->put (undef) for @a_trs; + $c_res->shutdown; + $c_arc->shutdown; + $c_trs->shutdown; print "start file scan, arc, res processing...\n" if $VERBOSE; @@ -642,8 +642,8 @@ print "end arc, start png processing...\n" if $VERBOSE; - # four png crunchers work fine for my 2x smp machine - my @a_png = map +(async \&process_png), 1..4; + # eight png crunchers work fine for my 4x smp machine + my @a_png = map +(async \&process_png), 1..8; $_->join for (@a_trs, @a_res, @a_png);