when multithreads stop at "sudo -v", you need input ^C more than
one time to terminate depanneur. The reason is main thread blocked
by "lock($DETACHING)" and it can't response to ^C immediately. So
use another lock variable "$SUDOV_LOCK" for "sudo -v".
# Prevents double detach attempts
my $DETACHING:shared;
+# Prevents main thread response to "^C" be blocked by DETACHING
+my $SUDOV_LOCK:shared;
+
# Flag to inform main thread update pkgdeps
my $dirty:shared=0;
my @args = ();
my @args_inc = ();
{
- lock ($DETACHING);
+ lock ($SUDOV_LOCK);
if ($TERM == 1 || my_system("sudo -v") != 0) {
return -1;
}