diff options
| author | Paul Buetow <paul@buetow.org> | 2012-03-16 08:40:10 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2012-03-16 08:40:10 +0100 |
| commit | 36a5356ee4f960f56d2b6891674e906503e49f62 (patch) | |
| tree | 30c363e763b0831d57fe28c77388c6042e6a0ff7 | |
| parent | c6b5e8b3552094e3534258b0b2ad1d77fdcbf15d (diff) | |
PIDS is now a hash
| -rwxr-xr-x | loadbars | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -59,7 +59,7 @@ use constant { $| = 1; -my @PIDS : shared; +my %PIDS : shared; my %AVGSTATS : shared; my %CPUSTATS : shared; my %MEMSTATS : shared; @@ -200,7 +200,7 @@ sub terminate_pids (@) { display_info 'Terminating sub-processes, hasta la vista!'; $_->kill('TERM') for @threads; display_info_no_nl 'Terminating PIDs'; - for my $pid (@PIDS) { + for my $pid (keys %PIDS) { my $proc_table = Proc::ProcessTable->new(); for my $proc (@{$proc_table->table()}) { if ($proc->ppid == $pid) { @@ -252,7 +252,7 @@ BASH next; }; - push @PIDS, $pid; + $PIDS{$pid} = 1; # Toggle CPUs $SIG{USR1} = sub { $sigusr1 = 1 }; |
