From 82e4d0b84d9e0ebc50b80c41f2cc34dc78740ebe Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Mon, 31 Aug 2009 22:58:15 -0400 Subject: [PATCH] Important fix - prep for release (0.02) Fix parsing of positional arguments in acquire() that could ignore the default "undo" parameter of "1". --- Changes | 4 ++++ README | 2 +- lib/IPC/Semaphore/Concurrency.pm | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 6c8d798..8f8f941 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension IPC::Semaphore::Concurrency. +0.02 Tue Sep 1 02:52:04 2009 + - Fix parsing of positional arguments in acquire() that could ignore the + default "undo" parameter of "1". + 0.01 Fri Aug 28 23:23:12 2009 - original version; created by h2xs 1.23 with options -AX IPC::Semaphore::Concurrency diff --git a/README b/README index ca021b4..9cb64ac 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -IPC-Semaphore-Concurrency version 0.01 +IPC-Semaphore-Concurrency version 0.02 ====================================== This module allows you to limit concurrency of specific portions of your diff --git a/lib/IPC/Semaphore/Concurrency.pm b/lib/IPC/Semaphore/Concurrency.pm index ac990a8..770dc17 100644 --- a/lib/IPC/Semaphore/Concurrency.pm +++ b/lib/IPC/Semaphore/Concurrency.pm @@ -15,7 +15,7 @@ our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw(); -our $VERSION = '0.01'; +our $VERSION = '0.02'; sub new { my $class = shift; @@ -145,10 +145,10 @@ sub acquire { %args = @_; } # Defaults - $args{'sem'} = 0 if (!exists($args{'sem'})); - $args{'wait'} = 0 if (!exists($args{'wait'})); - $args{'max'} = -1 if (!exists($args{'max'})); - $args{'undo'} = 1 if (!exists($args{'undo'})); + $args{'sem'} = 0 if (!defined($args{'sem'})); + $args{'wait'} = 0 if (!defined($args{'wait'})); + $args{'max'} = -1 if (!defined($args{'max'})); + $args{'undo'} = 1 if (!defined($args{'undo'})); my $sem = $self->{'_args'}->{'sem'}; my $flags = IPC_NOWAIT; -- 2.11.4.GIT