DynGig-Util
view release on metacpan or search on metacpan
lib/DynGig/Util/EZDB.pm view on Meta::CPAN
263264265266267268269270271272273274275276277278279280281282283
my
$handle
=
$this
->{sth};
return
unless
$table
&&
$handle
->{
$table
};
my
(
$sth
,
$result
) =
$handle
->{
$table
}{
$name
};
while
(
$sth
)
{
$result
=
eval
{
$sth
->execute(
@_
) };
last
unless
$@;
croak $@
if
$@ !~ /locked/;
}
return
$result
,
$sth
;
}
=head1 SEE ALSO
DBI
=head1 NOTE
lib/DynGig/Util/LockFile/PID.pm view on Meta::CPAN
100101102103104105106107108109110111112113114115116117118119{
my
$this
=
shift
;
my
$handle
=
$$this
;
sysseek
$handle
, 0, 0;
return
$handle
;
}
=head2 check( $filename )
Returns ID of process that owns the lock. Returns 0 if not locked.
=cut
sub
check
{
my
(
$class
,
$file
) =
@_
;
croak
'lock file not defined'
unless
defined
$file
;
my
(
$handle
,
$pid
);
lib/DynGig/Util/LockFile/Time.pm view on Meta::CPAN
151617181920212223242526272829303132333435=head1 SYNOPSIS
use DynGig::Util::LockFile::Time;
my $lock = '/lock/file/path';
DynGig::Util::LockFile::Time->lock( $lock, epoch => 3600, duration => 1200 );
die "locked\n" if my $seconds = DynGig::Util::LockFile::Time->check( $lock );
=head1 DESCRIPTION
=head2 lock( file, epoch => start, duration => seconds )
Writes time into the file.
=cut
sub
lock
{
( run in 0.252 second using v1.01-cache-2.11-cpan-55f5a4728d2 )