reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Lock.cxx
Go to the documentation of this file.
1
#include "
rutil/Lock.hxx
"
2
3
4
using
resip::ReadLock
;
5
using
resip::WriteLock
;
6
using
resip::PtrLock
;
7
8
using
resip::RWMutex
;
9
10
11
ReadLock::ReadLock
(
RWMutex
&
lockable
)
12
: mLockable(
lockable
)
13
{
14
lockable.
readlock
();
15
}
16
17
ReadLock::~ReadLock
()
18
{
19
mLockable.
unlock
();
20
}
21
22
WriteLock::WriteLock
(
RWMutex
& lockable)
23
: mLockable(lockable)
24
{
25
lockable.
writelock
();
26
}
27
28
WriteLock::~WriteLock
()
29
{
30
mLockable.
unlock
();
31
}
32
33
34
PtrLock::PtrLock
(
Mutex
* lockable)
35
: myLockable(lockable)
36
{
37
if
(lockable)
38
lockable->lock();
39
}
40
41
PtrLock::~PtrLock
()
42
{
43
if
(myLockable)
44
myLockable->unlock();
45
}
46
47
/* ====================================================================
48
* The Vovida Software License, Version 1.0
49
*
50
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
51
*
52
* Redistribution and use in source and binary forms, with or without
53
* modification, are permitted provided that the following conditions
54
* are met:
55
*
56
* 1. Redistributions of source code must retain the above copyright
57
* notice, this list of conditions and the following disclaimer.
58
*
59
* 2. Redistributions in binary form must reproduce the above copyright
60
* notice, this list of conditions and the following disclaimer in
61
* the documentation and/or other materials provided with the
62
* distribution.
63
*
64
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
65
* and "Vovida Open Communication Application Library (VOCAL)" must
66
* not be used to endorse or promote products derived from this
67
* software without prior written permission. For written
68
* permission, please contact vocal@vovida.org.
69
*
70
* 4. Products derived from this software may not be called "VOCAL", nor
71
* may "VOCAL" appear in their name, without prior written
72
* permission of Vovida Networks, Inc.
73
*
74
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
75
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
76
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
77
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
78
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
79
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
80
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
81
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
82
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
83
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
84
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
85
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
86
* DAMAGE.
87
*
88
* ====================================================================
89
*
90
* This software consists of voluntary contributions made by Vovida
91
* Networks, Inc. and many individuals on behalf of Vovida Networks,
92
* Inc. For more information on Vovida Networks, Inc., please see
93
* <http://www.vovida.org/>.
94
*
95
*/
Lock.hxx
resip::PtrLock
Much like class Lock above, but takes pointer argument to Lockable, which may be NULL.
Definition
Lock.hxx:57
resip::PtrLock::~PtrLock
virtual ~PtrLock()
Definition
Lock.cxx:41
resip::PtrLock::PtrLock
PtrLock(Mutex *)
Definition
Lock.cxx:34
resip::RWMutex
Wraps the readers/writers mutex implementation on your platform.
Definition
RWMutex.hxx:29
resip::RWMutex::writelock
void writelock()
Definition
RWMutex.cxx:86
resip::RWMutex::unlock
void unlock()
Definition
RWMutex.cxx:111
resip::RWMutex::readlock
void readlock()
Definition
RWMutex.cxx:72
resip::ReadLock
Definition
Lock.hxx:32
resip::ReadLock::ReadLock
ReadLock(RWMutex &)
Definition
Lock.cxx:11
resip::ReadLock::~ReadLock
virtual ~ReadLock()
Definition
Lock.cxx:17
resip::WriteLock
Definition
Lock.hxx:41
resip::WriteLock::WriteLock
WriteLock(RWMutex &)
Definition
Lock.cxx:22
resip::WriteLock::~WriteLock
virtual ~WriteLock()
Definition
Lock.cxx:28
resip::Mutex
std::mutex Mutex
A semaphore that can be locked by only one thread at a time.
Definition
Mutex.hxx:37
list
void list()
Definition
userAdmin.cxx:66
rutil
Lock.cxx
Generated by
1.9.8