1docs::api::APR::ThreadRUWsLeorckC(o3n)tributed Perl Docudmoecnst:a:taipoin::APR::ThreadRWLock(3)
2
3
4

NAME

6       APR::ThreadRWLock - Perl API for APR thread read/write locks
7

Synopsis

9         use APR::ThreadRWLock ();
10
11         my $mutex = APR::ThreadRWLock->new($r->pool);
12         $mutex->rdlock;
13         $mutex->wrlock;
14         $mutex->tryrdlock;
15         $mutex->trywrlock;
16         $mutex->unlock;
17

Description

19       "APR::ThreadRWLock" interfaces APR thread read/write locks.
20
21       See srclib/apr/locks/unix/thread_rwlock.c in your Apache source tree.
22       At the time of this writing these methods are not supported on all
23       platforms. Thus, check your libraries!
24

API

26       "APR::ThreadRWLock" provides the following functions and/or methods:
27

Unsupported API

29       "APR::ThreadRWLock" also provides auto-generated Perl interface for a
30       few other methods which aren't tested at the moment and therefore their
31       API is a subject to change. These methods will be finalized later as a
32       need arises. If you want to rely on any of the following methods please
33       contact the the mod_perl development mailing list so we can help each
34       other take the steps necessary to shift the method to an officially
35       supported API.
36
37   "DESTROY"
38       META: Autogenerated - needs to be reviewed/completed
39
40       Destroy the lock and free the associated memory.
41
42         $lock->DESTROY();
43
44       obj: $lock ( "APR::ThreadRWLock object" )
45           the lock to destroy.
46
47       ret: no return value
48       since: subject to change
49
50   "rdlock"
51       META: Autogenerated - needs to be reviewed/completed
52
53       Acquire the read lock for the given lock. The calling thread acquires
54       the read lock if a writer does not hold the lock and there are  no
55       writers blocked on the lock. Otherwize it is put to sleep until these
56       conditions are met.
57
58         $ret = $lock->rdlock();
59
60       obj: $lock ( "APR::ThreadRWLock object" )
61           the lock on which to acquire the lock.
62
63       ret: $ret ( integer )
64       since: subject to change
65
66   "tryrdlock"
67       META: Autogenerated - needs to be reviewed/completed
68
69       Performs the same operation as "rdlock" with the exception that the
70       function shall fail if the thread would be blocked.
71
72         $ret = $lock->tryrdlock();
73
74       obj: $lock ( "APR::ThreadRWLock object" )
75           the lock on which to acquire the lock.
76
77       ret: $ret ( integer )
78       since: subject to change
79
80   "wrlock"
81       META: Autogenerated - needs to be reviewed/completed
82
83       Acquire the write lock for the given lock. The calling thread acquires
84       the write lock if if no other thread (reader or writer) holds it.
85       Otherwize it is put to sleep until this condition is met.
86
87         $ret = $lock->wrlock();
88
89       obj: $lock ( "APR::ThreadRWLock object" )
90           the lock on which to acquire the lock.
91
92       ret: $ret ( integer )
93       since: subject to change
94
95   "trywrlock"
96       META: Autogenerated - needs to be reviewed/completed
97
98       Performs the same operation as "wrlock" with the exception that the
99       function shall fail if the thread would be blocked.
100
101         $ret = $lock->trywrlock();
102
103       obj: $lock ( "APR::ThreadRWLock object" )
104           the lock on which to acquire the lock.
105
106       ret: $ret ( integer )
107       since: subject to change
108
109   "new"
110       Create a new lock