Qmail::Control::Lock - Perl extension for locking Qmail's control file subsystem.
use Qmail::Control::Lock; my $lock = Qmail::Control::Lock->new(); # Get a shared lock on the control subsystem. $lock->lock_shared() or die "Couldn't get sh lock: $!\n"; # Get an exclusive lock on the control subsystem. $lock2->lock_exclusive() or die "Couldn't get ex lock: $!\n"; # Change a shared lock to an exclusive lock. $lock->relock('exclusive') or die "Couldn't change sh to ex lock: $!\n"; # Unlock the control subsystem. $lock->unlock(); $lock2->unlock();
Qmail::Control::Lock provides and interface for locking Qmail's control file subsystem.
Dan Bernstein does not endorse this module or this locking method, and as far as I know, only Qmail::Control::Lock uses it.
None by default.
Creates a new Qmail::Control::Lock object.
Returns a reference to the newly created object.
Takes no arguments, currently. This may change, but the argumentless form will always exist.
Gets a shared lock on the Qmail control file subsystem.
Returns true on success or undef on a serious error.
Takes no arguments.
Gets an exclusive lock on the Qmail control file subsystem.
Changes one type of lock (either shared or exclusive) into another.
Takes a single argument, either 'shared' or 'exclusive', which indicates which type of lock to engage. If you pass 'shared', and the lock is already 'shared', this is a no-op.
Unlocks the Qmail control file subsystem.
Returns nothing.
Paul Prince, <princep@charter.net>
perl. Qmail::Control::Lock.
To install Qmail::Control, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Qmail::Control
CPAN shell
perl -MCPAN -e shell install Qmail::Control
For more information on module installation, please visit the detailed CPAN module installation guide.