NAME
Captive::Portal::LockHandle - lock handling for Captive::Portal
DESCRIPTION
Inherit from FileHandle, add locking and DESTROY().
CONSTRUCTION and DESTROY
- $handle = Captive::Portal::LockHandle->new(%options)
-
Returns a filehandle with the requested lock assigned. There is no unlock, after destroying the filehandle the file is automatically closed and the lock released.
Options:
file => filename to lock, created if not existing shared => shared lock, defaults to exclusive lock blocking => blocking lock request, defaults to blocking try => number of retries in nonblocking mode, defaults to 1 retry timeout => timeout in blocking mode, defaults to 1s
- $handle->DESTROY()
-
Called whenever the locked filehandle is destroyed. Just implemented to get proper debug messages for locking/unlocking.
AUTHOR
Karl Gaissmaier, <gaissmai at cpan.org>
LICENSE AND COPYRIGHT
Copyright 2010-2013 Karl Gaissmaier, all rights reserved.
This distribution is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or
b) the Artistic License version 2.0.