YARP
Yet Another Robot Platform
RecursiveMutex.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3
* All rights reserved.
4
*
5
* This software may be modified and distributed under the terms of the
6
* BSD-3-Clause license. See the accompanying LICENSE file for details.
7
*/
8
9
#define YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE
10
#include <
yarp/os/RecursiveMutex.h
>
11
#undef YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE
12
13
#include <mutex>
14
15
using
yarp::os::RecursiveMutex
;
16
17
class
RecursiveMutex::Private
18
{
19
public
:
20
std::recursive_mutex
mutex
;
21
};
22
23
RecursiveMutex::RecursiveMutex() :
24
mPriv(new
Private
)
25
{
26
}
27
28
RecursiveMutex::~RecursiveMutex
()
29
{
30
delete
mPriv;
31
}
32
33
void
RecursiveMutex::lock
()
34
{
35
mPriv->mutex.lock();
36
}
37
38
bool
RecursiveMutex::try_lock
()
39
{
40
return
mPriv->mutex.try_lock();
41
}
42
43
void
RecursiveMutex::unlock
()
44
{
45
mPriv->mutex.unlock();
46
}
47
48
bool
RecursiveMutex::tryLock
()
49
{
50
return
mPriv->mutex.try_lock();
51
}
yarp::os::RecursiveMutex
RecursiveMutex offers exclusive, recursive ownership semantics:
Definition:
RecursiveMutex.h:44
RecursiveMutex.h
yarp::os::RecursiveMutex::~RecursiveMutex
~RecursiveMutex()
Destructor.
Definition:
RecursiveMutex.cpp:28
yarp::os::RecursiveMutex::lock
void lock()
Lock the associated resource, waiting if the resource is busy.
Definition:
RecursiveMutex.cpp:33
yarp::os::RecursiveMutex::unlock
void unlock()
Unlock the associated resource thus freeing waiting threads.
Definition:
RecursiveMutex.cpp:43
yarp::os::RecursiveMutex::tryLock
bool tryLock()
Lock the associated resource if it is free.
Definition:
RecursiveMutex.cpp:48
yarp::os::RecursiveMutex::Private
Definition:
RecursiveMutex.cpp:18
yarp::os::RecursiveMutex::try_lock
bool try_lock()
Lock the associated resource if it is free.
Definition:
RecursiveMutex.cpp:38
yarp::os::RecursiveMutex::Private::mutex
std::recursive_mutex mutex
Definition:
RecursiveMutex.cpp:20
YARP
3.4.100+20201223.2+gitb8ea4d712
src
libYARP_os
src
yarp
os
RecursiveMutex.cpp
Generated on Sun Jan 3 2021 02:46:25 for YARP by
1.8.20