summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2012-03-16 08:40:10 +0100
committerPaul Buetow <paul@buetow.org>2012-03-16 08:40:10 +0100
commit36a5356ee4f960f56d2b6891674e906503e49f62 (patch)
tree30c363e763b0831d57fe28c77388c6042e6a0ff7
parentc6b5e8b3552094e3534258b0b2ad1d77fdcbf15d (diff)
PIDS is now a hash
-rwxr-xr-xloadbars6
1 files changed, 3 insertions, 3 deletions
diff --git a/loadbars b/loadbars
index 09bc2b8..7ceeed7 100755
--- a/loadbars
+++ b/loadbars
@@ -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 };