NAME

Genezzo::Contrib::Clustered::GLock::GLock - Generic locking for Genezzo

SYNOPSIS

$curLock = new GLock(lock => $lockName, block => 1);
$curLock->lock(shared => 0);
$curLock->promote();
$curLock->unlock();

DESCRIPTION

Basic locking for Genezzo. Available implementations include None (default), Unix Record fcntl, and OpenDLM. None is acceptable when only a single process accesses the database. Unix Record should be used when multiple proccesses on a single machine access the database. DLM is required when processes on multiple machines access the database.

FUNCTIONS

new (lock => NAME, block => BLOCKING)

Creates new lock with name NAME. Blocking if BLOCKING=1 (default). Depending on implementation, new or following lock() may be blocking.

lock (shared => SHARED)

Locks lock. Shared if SHARED=1, otherwise Exclusive (default). Returns undef for failure.

promote

Promotes lock from Shared to Exclusive. Returns undef for failure.

demote

Demotes lock from Exclusive to Shared. Returns undef for failure.

unlock

Unlocks lock.

ast_poll

Returns 1 if recent asyncronous request for lock held by process. 0 otherwise.

LIMITATIONS

Edit $IMPL to choose implementation. This will eventually be configured from somewhere else.

IPC::Locker implementation is not currently being maintained or tested.

AUTHOR

Eric Rollins, rollins@acm.org

Copyright (c) 2005 Eric Rollins. All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

Address bug reports and comments to rollins@acm.org

For more information, please visit the Genezzo homepage at http://www.genezzo.com

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 292:

'=item' outside of any '=over'

Around line 296:

You forgot a '=back' before '=head1'