1Apache::Session::Lock::UFsielre(C3o)ntributed Perl DocumAepnatcahtei:o:nSession::Lock::File(3)
2
3
4

NAME

6       Apache::Session::Lock::File - Provides mutual exclusion using flock
7

SYNOPSIS

9        use Apache::Session::Lock::File;
10
11        my $locker = Apache::Session::Lock::File->new;
12
13        $locker->acquire_read_lock($ref);
14        $locker->acquire_write_lock($ref);
15        $locker->release_read_lock($ref);
16        $locker->release_write_lock($ref);
17        $locker->release_all_locks($ref);
18
19        $locker->clean($dir, $age);
20

DESCRIPTION

22       Apache::Session::Lock::File fulfills the locking interface of
23       Apache::Session.  Mutual exclusion is achieved through the use of
24       temporary files and the "flock" function.
25

CONFIGURATION

27       The module must know where to create its temporary files.  You must
28       pass an argument in the usual Apache::Session style.  The name of the
29       argument is LockDirectory and its value is the path where you want the
30       lockfiles created.  Example:
31
32        tie %s, 'Apache::Session::Blah', $id, {LockDirectory => '/var/lock/sessions'}
33
34       If you do not supply this argument, temporary files will be created in
35       /tmp.
36

NOTES

38   clean
39       This module does not unlink temporary files, because it interferes with
40       proper locking.  This can cause problems on certain systems (Linux)
41       whose file systems (ext2) do not perform well with lots of files in one
42       directory.  To prevent this you should use a script to clean out old
43       files from your lock directory.  The meaning of old is left as a policy
44       decision for the implementor, but a method is provided for implementing
45       that policy.  You can use the "clean" method of this module to remove
46       files unmodified in the last $age seconds.  Example:
47
48        my $l = Apache::Session::Lock::File->new;
49        $l->clean('/var/lock/sessions', 3600) #remove files older than 1 hour
50
51   acquire_read_lock
52       Will do nothing if write lock is in effect, only set readlock flag to
53       true.
54
55   release_read_lock
56       Will do nothing if write lock is in effect, only set readlock flag to
57       false.
58
59   Win32 and Cygwin
60       Windows cannot escalate lock, so all locks will be exclusive.
61
62       release_read_lock not supported - it is not used by Apache::Session.
63
64       When deleting files, they are not locked (Win32 only).
65

AUTHOR

67       This module was written by Jeffrey William Baker <jwbaker@acm.org>.
68

SEE ALSO

70       Apache::Session
71
72
73
74perl v5.34.0                      2022-01-20    Apache::Session::Lock::File(3)
Impressum