################################################################################
use strict;
+use Carp;
use vars qw(
@EXPORT_OK
%EXPORT_TAGS
# and wait $timeout seconds for
# references == 0 (no shared locks set)
#
- &simple_lock ($filename,$timeout) or return;
+ &simple_lock ($filename,$timeout) or return 0;
for (0..$timeout) {
# lock reference counter
# or fail
#
unless (&simple_lock (&reffile($filename),$timeout)) {
&simple_unlock($filename,$timeout);
- return;
+ return 0;
}
# ready if we have no shared locks
#
unless (&simple_unlock (&reffile($filename),$timeout)) {
&simple_unlock($filename,$timeout);
- return;
+ return 0;
}
sleep(1);
}
# and wait $timeout seconds for
# references == 0 (no shared locks set)
#
- &simple_lock ($filename,$timeout) or return;
+ &simple_lock ($filename,$timeout) or return 0;
for (0..$timeout) {
# lock reference counter
#
unless (&simple_lock (&reffile($filename),$timeout)) {
&simple_unlock($filename,$timeout);
- return;
+ return 0;
}
# ready if we have no shared locks
#
unless (&simple_unlock (&reffile($filename),$timeout)) {
&simple_unlock($filename,$timeout);
- return;
+ return 0;
}
sleep(1);
}
&lockfile(&masterfile($_[0]));
}
sub masterfile ($) {
+ confess unless defined $_[0];
"$_[0].master";
}
#
#
-### end of Lock ################################################################
+### end of Lock ################################################################
\ No newline at end of file