mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
mtr_process.pl:
Call mtr_timer_stop_all() at exit mtr_report.pl, mysql-test-run.pl: Added default/ps-protocol/embedded to abort and summary line mtr_timer.pl: Added function mtr_timer_stop_all() mysql-test/mysql-test-run.pl: Added default/ps-protocol/embedded to abort and summary line mysql-test/lib/mtr_timer.pl: Added function mtr_timer_stop_all() mysql-test/lib/mtr_report.pl: Added default/ps-protocol/embedded to abort and summary line mysql-test/lib/mtr_process.pl: Call mtr_timer_stop_all() at exit
This commit is contained in:
@ -15,6 +15,7 @@ use POSIX 'WNOHANG';
|
||||
sub mtr_init_timers ();
|
||||
sub mtr_timer_start($$$);
|
||||
sub mtr_timer_stop($$);
|
||||
sub mtr_timer_stop_all($);
|
||||
sub mtr_timer_waitpid($$$);
|
||||
|
||||
##############################################################################
|
||||
@ -113,6 +114,29 @@ sub mtr_timer_stop ($$) {
|
||||
}
|
||||
|
||||
|
||||
sub mtr_timer_stop_all ($) {
|
||||
my $timers= shift;
|
||||
|
||||
foreach my $name ( keys %{$timers->{'timers'}} )
|
||||
{
|
||||
my $tpid= $timers->{'timers'}->{$name}->{'pid'};
|
||||
|
||||
# FIXME as Cygwin reuses pids fast, maybe check that is
|
||||
# the expected process somehow?!
|
||||
kill(9, $tpid);
|
||||
|
||||
# As the timers are so simple programs, we trust them to terminate,
|
||||
# and use blocking wait for it. We wait just to avoid a zombie.
|
||||
waitpid($tpid,0);
|
||||
|
||||
delete $timers->{'timers'}->{$name}; # Remove the timer information
|
||||
delete $timers->{'pids'}->{$tpid}; # and PID reference
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub mtr_timer_timeout ($$) {
|
||||
my ($timers,$pid)= @_;
|
||||
|
||||
|
Reference in New Issue
Block a user