MRPT  2.0.4
lock_helper_unittest.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include <gtest/gtest.h>
11 #include <mrpt/core/lock_helper.h>
12 #include <mutex>
13 
14 TEST(lock_helper, testCompilation)
15 {
16  {
17  std::mutex mtx;
18  {
19  auto lck = mrpt::lockHelper(mtx);
20  // protected code
21  }
22  }
23  {
24  std::recursive_mutex mtx;
25  {
26  auto lck = mrpt::lockHelper(mtx);
27  // protected code
28  }
29  }
30 }
LockHelper< T > lockHelper(T &t)
Syntactic sugar to easily create a locker to any kind of std::mutex.
Definition: lock_helper.h:50
TEST(lock_helper, testCompilation)



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020