[SCM] Debian native package for Config::Model::Dpkg branch, master, updated. debian/2.035-10-g90516db
Dominique Dumont
dod at debian.org
Sat Apr 27 15:02:32 UTC 2013
The following commit has been merged in the master branch:
commit be416064df732f3d03bdd356313c10c047e3f44c
Author: Dominique Dumont <dod at debian.org>
Date: Sat Apr 27 16:01:50 2013 +0200
Dependency: remove condvar send/recv calls. begin/end is enough
send/recv which blocks until all callback are done which is not what
is required during store check.
diff --git a/lib/Config/Model/Dpkg/Dependency.pm b/lib/Config/Model/Dpkg/Dependency.pm
index 0540344..b56172e 100644
--- a/lib/Config/Model/Dpkg/Dependency.pm
+++ b/lib/Config/Model/Dpkg/Dependency.pm
@@ -118,8 +118,9 @@ sub check_dependency {
= @args{qw/value check silent notify_change ok callback fix/} ;
# check_value is always called with a callback. This callback must
- # must called *after* all aysnchronous calls are done (which depends on the
- # packages listed in the dependency)
+ # must called *after* all asynchronous calls are done (which depends on the
+ # packages listed in the dependency). So use begin and end on this condvar and
+ # nothing else, not send/recv
my $pending_check = AnyEvent->condvar ;
# value is one dependency, something like "perl ( >= 1.508 )"
@@ -135,6 +136,10 @@ sub check_dependency {
my $old = $value ;
my @fixed_dep ; # filled by callback and used when applying fixes
+ # this callback will be launched when all checks are done. this can be at
+ # the 'end' call at this end of this sub if all calls of check_depend are
+ # synchronous (which may be the case if all dependency informations are in cache)
+ # or it can be in one of the call backs
my $on_check_all_done = sub {
if ($logger->is_debug) {
$async_log->debug("in check_dependency callback for ",$self->composite_name)
@@ -151,7 +156,6 @@ sub check_dependency {
$self->_store_fix($old, $new) if $apply_fix and $new ne $old;
}
$callback->(%args) if $callback ;
- $pending_check->send ;
} ;
$async_log->debug("begin for ",$self->composite_name) if $async_log->is_debug;
@@ -164,15 +168,8 @@ sub check_dependency {
}
- $async_log->debug("waiting end for ",$self->composite_name) if $async_log->is_debug;
- $pending_check->end;
$async_log->debug("end for ",$self->composite_name) if $async_log->is_debug;
-
- $async_log->debug("waiting until all results for ",$self->composite_name," are back")
- if $async_log->is_debug;
- $pending_check->recv; # block until all checks are done
- $async_log->debug("all results for ",$self->composite_name, " are back")
- if $async_log->is_debug;
+ $pending_check->end;
}
sub check_debhelper {
--
Debian native package for Config::Model::Dpkg
More information about the Pkg-perl-cvs-commits
mailing list