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
111
112         my $lock = APR::ThreadRWLock->new($p);
113
114       obj: "APR::ThreadRWLock" ( class name )
115       arg1: $p ( "APR::Pool object" )
116       ret: $lock ( "APR::ThreadRWLock object" )
117       since: subject to change
118
119   "pool_get"
120       META: Autogenerated - needs to be reviewed/completed
121
122       META: should probably be renamed to pool(), like all other pool
123       accessors
124
125       Get the pool used by this thread_lock.
126
127         $ret = $obj->pool_get();
128
129       obj: $obj ( "APR::ThreadRWLock object" )
130       ret: $ret ( "APR::Pool object" )
131           apr_pool_t the pool
132
133       since: subject to change
134
135   "unlock"
136       META: Autogenerated - needs to be reviewed/completed
137
138       Release the lock for the given lock.
139
140         $ret = $lock->unlock();
141
142       obj: $lock ( "APR::ThreadRWLock object" )
143           the lock from which to release the lock.
144
145       ret: $ret ( integer )
146       since: subject to change
147

See Also

149       mod_perl 2.0 documentation.
150
152       mod_perl 2.0 and its core modules are copyrighted under The Apache
153       Software License, Version 2.0.
154

Authors

156       The mod_perl development team and numerous contributors.
157
158
159
160perl v5.32.1                      2021-01-26   docs::api::APR::ThreadRWLock(3)
Impressum