From: Matt S Trout Date: Tue, 15 Nov 2011 08:41:01 +0000 (+0000) Subject: protect against re-upgrading X-Git-Tag: v0.001002~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb0f5964bfe05daa3f82ec9261cfc0bb9d181223;p=scpubgit%2FTak.git protect against re-upgrading --- diff --git a/lib/Tak.pm b/lib/Tak.pm index ce3ca2e..65a6153 100644 --- a/lib/Tak.pm +++ b/lib/Tak.pm @@ -5,15 +5,17 @@ use strictures 1; our $VERSION = '0.001001'; # 0.1.1 -our $loop; +our ($loop, $did_upgrade); sub loop { $loop ||= Tak::Loop->new } sub loop_upgrade { + return if $did_upgrade; require IO::Async::Loop; my $new_loop = IO::Async::Loop->new; $loop->pass_watches_to($new_loop) if $loop; $loop = $new_loop; + $did_upgrade = 1; } sub loop_until {