NAME

App::Locker - lock/unlock you perl script

SYNOPSIS

use App::Locker;

my $locker=App::Locker->create;

my $pid=fork();

if (!$pid){

# child
sleep(1);
$locker->unlock;
sleep(1);

} else { # parent

print "LOCK\n";
$locker->lock();
print "UNLOCK\n";
}

DESCRIPTION

This module provides create lock point in any place scipt and unlock it from another script place (main, fork, thread).

create my $locker=App::Locker->create;

create main object thith lock api

destroy $locker->destroy

destroy main object

lock $locker->lock # for simple lock OR my $data = $locker->lock # lock thith transfer any data

lock execute script

unlock $locker->unlock # for simple unlock OR

$locker->unlock($data) # unlock thith transfer any data ($data - must by reference)

lock execute script

AUTHOR

Bulichev Evgeniy, bes@cpan.org>.

COPYRIGHT

Copyright (c) 2017 Bulichev Evgeniy.  All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.