MRPT  2.0.1
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.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020