mCRL2
Loading...
Searching...
No Matches
mutex.h
Go to the documentation of this file.
1// Author(s): Maurice Laveaux
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9
10#ifndef MCRL2_UTILITIES_MUTEX_H_
11#define MCRL2_UTILITIES_MUTEX_H_
12
13#include <mutex>
14
16
17namespace mcrl2::utilities
18{
19
22class mutex
23{
24public:
25 void lock() {
27 m_mutex.lock();
28 }
29 }
30
31 void unlock()
32 {
34 m_mutex.unlock();
35 }
36 }
37
38private:
39 std::mutex m_mutex;
40};
41
42} // namespace mcrl2::utilities
43
44#endif // MCRL2_UTILITIES_MUTEX_H_
This is simply an exclusive lock based on the standard library with the ability to perform no locks w...
Definition mutex.h:23
std::mutex m_mutex
Definition mutex.h:39
static constexpr bool GlobalThreadSafe
Enables thread safety for the whole toolset.