YARP
Yet Another Robot Platform
Mutex.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_OS_MUTEX_H
7#define YARP_OS_MUTEX_H
8
9#include <yarp/conf/system.h>
10
11#if !defined(YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE)
12YARP_COMPILER_WARNING("<yarp/os/Mutex.h> file is deprecated")
13#endif
14
15#ifndef YARP_NO_DEPRECATED // Since YARP 3.3
16
17#include <yarp/os/api.h>
18#include <mutex>
19
20namespace yarp::os {
21
30class YARP_os_DEPRECATED_API_MSG("Use std::mutex instead") Mutex
31{
32public:
36 Mutex();
37
41 ~Mutex();
42
48 void lock();
49
57 bool try_lock();
58
64 void unlock();
65
75 YARP_DEPRECATED_MSG("Use try_lock() instead")
76 bool tryLock();
77
78#ifndef DOXYGEN_SHOULD_SKIP_THIS
79private:
80 class Private;
81 Private* mPriv;
82#endif // DOXYGEN_SHOULD_SKIP_THIS
83};
84
85} // namespace yarp::os
86
87#endif // YARP_NO_DEPRECATED
88
89#endif // YARP_OS_MUTEX_H
Basic wrapper for mutual exclusion.
Definition: Mutex.h:31
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition: compiler.h:2895
STL namespace.
An interface to the operating system, including Port based communication.
#define YARP_COMPILER_WARNING(x)
Generate a warning at build time on supported compilers.
Definition: system.h:111
#define YARP_os_DEPRECATED_API_MSG(X)
Definition: api.h:21