Eric Rollins > Genezzo-Contrib-Clustered-0.34 > Genezzo::Contrib::Clustered::GLock::GLockUR

Download:
Genezzo-Contrib-Clustered-0.34.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Genezzo::Contrib::Clustered::GLock::GLockUR - Unix record locking implementation for Genezzo

SYNOPSIS ^

    my $lockid = ur_lock($name, $shared, $blocking);
    my $success = ur_promote($name, $lockid, $blocking);
    my $success = ur_unlock($lockid);

DESCRIPTION ^

Provides Perl wrappers to basic Unix record fcntl C functions.

FUNCTIONS ^

ur_lock NAME, SHARED, BLOCKING

Locks lock with name NAME. Shared if SHARED=1, otherwise exclusive. Blocking if BLOCKING=1, otherwise returns immediately. Returns lockid,or 0 for failure.

ur_promote NAME, LOCKID, BLOCKING

Promotes lock with name NAME and lockid LOCKID to exclusive mode. Returns 1 for success, or 0 for failure.

ur_demote NAME, LOCKID, BLOCKING

Demotes lock with name NAME and lockid LOCKID to shared mode. Returns 1 for success, or 0 for failure.

ur_unlock LOCKID

Releases lock with lockid LOCKID. Returns 1 for success, 0 for failure.

EXPORT

ur_lock, ur_promote, ur_unlock

LIMITATIONS ^

Relies on Perl Inline::C module. Currently terminates program when deadlock detected.

Inline code is installed in directory /Inline, so it can be used with Apache.

A file /tmp/genezzo.lock is created. It must be writeable by the accessing processes. The undo file should probably be used for locking instead.

All processes must be owned by the same user; otherwise kill SIGUSR2 signals will be blocked.

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

syntax highlighting: