tests: don’t overwrite $timeout, kill timer when done

This commit is contained in:
Michael Stapelberg 2011-10-04 23:36:43 +01:00
parent 4e1d50fa3a
commit 359717970d
1 changed files with 2 additions and 1 deletions

View File

@ -104,9 +104,10 @@ sub wait_for_event {
};
# Trigger timeout after $timeout seconds (can be fractional)
my $timeout = AE::timer $timeout, 0, sub { warn "timeout"; $cv->send(0) };
my $t = AE::timer $timeout, 0, sub { warn "timeout ($timeout secs)"; $cv->send(0) };
my $result = $cv->recv;
undef $t;
return $result;
}