Name IPC::SRLock - Set/reset locking semantics to single thread processes Version This documents version v0.11.$Rev: 11 $ of IPC::SRLock Synopsis use IPC::SRLock; my $config = { tempdir => 'path_to_tmp_directory', type => 'fcntl' }; my $lock_obj = IPC::SRLock->new( $config ); $lock_obj->set( k => 'some_resource_identfier' ); # This critical region of code is guaranteed to be single threaded $lock_obj->reset( k => 'some_resource_identfier' ); Description Provides set/reset locking methods which will force a critical region of code to run single threaded Configuration and Environment Defines the following attributes; "debug" Mutable attribute if true will log lock set events at the debug level "type" Determines which factory subclass is loaded. Defaults to "fcntl", can be; "fcntl", "memcached", or "sysv" Subroutines/Methods BUILD Called after an instance is created this subroutine triggers the lazy evaluation of the concrete subclass get_table my $data = $lock_obj->get_table; Returns a hash ref that contains the current lock table contents. The keys/values in the hash are suitable for passing to HTML::FormWidgets list my $array_ref = $lock_obj->list; Returns an array of hash refs that represent the current lock table reset $lock_obj->reset( k => 'some_resource_key' ); Resets the lock referenced by the "k" attribute. set $lock_obj->set( k => 'some_resource_key' ); Sets the specified lock. Attributes are: "k" Unique key to identify the lock. Mandatory no default "p" Explicitly set the process id associated with the lock. Defaults to the current process id "t" Set the time to live for this lock. Defaults to five minutes. Setting it to zero makes the lock last indefinitely Diagnostics Setting "debug" to true will cause the "set" methods to log the lock record at the debug level Dependencies Moose Moose::Util::TypeConstraints MooseX::Types::LoadableClass MooseX::Types::Moose Incompatibilities The "sysv" subclass type will not work on "MSWin32" and "cygwin" platforms Bugs and Limitations Testing of the "memcached" subclass type is skipped on all platforms as it requires "memcached" to be listening on the localhost's default memcached port "localhost:11211" There are no known bugs in this module. Please report problems to the address below. Patches are welcome Author Peter Flanigan, "" License and Copyright Copyright (c) 2013 Peter Flanigan. All rights reserved This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE