GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IO::LAMBDA::FLOCK (3)

.ds Aq ’

NAME

IO::Lambda::Flock - lambda-style file locking

CONTENTS

DESCRIPTION

The module provides file locking interface for the lambda style, implemented by using non-blocking, periodic polling of flock(2).

SYNOPSIS



    open LOCK, ">lock";
    lambda {
        # obtain the lock
        context \*LOCK, timeout => 10;
        flock { die "cant obtain lock" unless shift }
       
        # while reading from handle
        context $handle;
        readable { ... }

        # and showing status
        context 0.5;
        timeout { print .; again }
    };



API

flock($filehandle, %options) -> ($lock_obtained = 1 | $timeout = 0) Waits until the file lock is obtained or the timeout is expired. When successful, the (shared or exclusive) lock on $filehandle is acquired by flock($filehandle, LOCK_NB) call. Options:
timeout or deadline These two options are synonyms, both declare the moment when the lambda waiting for the lock should give up. If undef, timeout never occurs.
shared If set, LOCK_SH is used, otherwise LOCK_EX.
frequency Defines how often the polling for the lock should occur. If left undefined, polling occurs during idle time, when other events are dispatched.

SEE ALSO

Fcntl, IO::Lambda::Poll.

AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 IO::LAMBDA::FLOCK (3) 2012-03-14

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.