YARP
Yet Another Robot Platform
RecursiveMutex.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_RECURSIVELOCK_H
7 #define YARP_OS_RECURSIVELOCK_H
8 
9 #include <yarp/conf/system.h>
10 
11 #if !defined(YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE)
12 YARP_COMPILER_WARNING("<yarp/os/RecursiveMutex.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 
20 namespace yarp {
21 namespace os {
22 
40 class YARP_os_DEPRECATED_API_MSG("Use std::recursive_mutex instead") RecursiveMutex
41 {
42 public:
47 
51  ~RecursiveMutex();
52 
61  void lock();
62 
70  bool try_lock();
71 
78  void unlock();
79 
89  YARP_DEPRECATED_MSG("Use try_lock() instead")
90  bool tryLock();
91 
92 #ifndef DOXYGEN_SHOULD_SKIP_THIS
93 private:
94  class Private;
95  Private* mPriv;
96 #endif // DOXYGEN_SHOULD_SKIP_THIS
97 };
98 
99 } // namespace os
100 } // namespace yarp
101 
102 #endif // YARP_NO_DEPRECATED
103 
104 #endif // YARP_OS_RECURSIVELOCK_H
RecursiveMutex offers exclusive, recursive ownership semantics:
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition: compiler.h:2885
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_COMPILER_WARNING(x)
Generate a warning at build time on supported compilers.
Definition: system.h:109
#define YARP_os_DEPRECATED_API_MSG(X)
Definition: api.h:21