summaryrefslogtreecommitdiff
path: root/loadbars.pl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-08-09 07:05:16 +0000
committerPaul Buetow <paul@buetow.org>2011-08-09 07:05:16 +0000
commit92d8f5f741799e79235e73ba8ce9e91d1ffc7c1f (patch)
tree1090a3dc668cc3471fc5809d0a47cb5fe1ce0d8b /loadbars.pl
parent2841ec9a61a50e2f0000f4c7e866dba5eefd3066 (diff)
some stuff
Diffstat (limited to 'loadbars.pl')
-rwxr-xr-xloadbars.pl14
1 files changed, 10 insertions, 4 deletions
diff --git a/loadbars.pl b/loadbars.pl
index 37ecbf6..9bb4d08 100755
--- a/loadbars.pl
+++ b/loadbars.pl
@@ -29,6 +29,8 @@
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+package Loadbars;
+
use strict;
use warnings;
@@ -114,7 +116,7 @@ sub parse_cpu_line ($) {
sub thread_get_stats ($) {
my $host = shift;
- my $sigusr1 = 0;
+ my ($sigusr1, $quit) = (0, 0);
my $loadavgexp = qr/(\d+\.\d{2}) (\d+\.\d{2}) (\d+\.\d{2})/;
for (;;) {
@@ -150,6 +152,9 @@ BASH
$SIG{USR1} = sub { $sigusr1 = 1 };
my $cpuregexp = qr/$C{cpuregexp}/;
+ # $SIG{STOP} = sub { debugsay kill 9, $pid; $quit = 1 };
+
+
while (<$pipe>) {
if (/^$loadavgexp/) {
$AVGSTATS{$host} = "$1;$2;$3";
@@ -160,7 +165,7 @@ BASH
map { $_ . '=' . $load->{$_} }
grep { defined $load->{$_} } keys %$load;
- not defined $load->{$_} and debugsay $_ for keys %$load;
+ not defined $load->{$_} for keys %$load;
}
if ($sigusr1) {
@@ -252,8 +257,6 @@ sub main_loop ($@) {
my $infotxt : shared = '';
my $quit : shared = 0;
- $SIG{STOP} = sub { $quit = 1 };
-
my ($t1, $t2) = (Time::HiRes::time(), undef);
my $event = SDL::Event->new();
@@ -531,6 +534,7 @@ TIMEKEEPER:
} until $quit;
say "Good bye";
+ # $_->kill('STOP') for @threads;
$event_thread->join();
exit 0;
}
@@ -706,3 +710,5 @@ sub main () {
}
main;
+
+1;