Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
SharedMutex.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_SHARED_MUTEX_BOOST_H_
34#define DVD_SHARED_MUTEX_BOOST_H_
35
36#include <shared_mutex>
37
38namespace Divide {
39
40using Mutex = std::mutex;
41using TimedMutex = std::timed_mutex;
42
43using SharedMutex = std::shared_mutex;
44using SharedTimedMutex = std::shared_timed_mutex;
45
46using RecursiveMutex = std::recursive_mutex;
47
48template<typename mutex>
49using SharedLock = std::shared_lock<mutex>;
50
51template<typename mutex>
52using UniqueLock = std::unique_lock<mutex>;
53
54template<typename mutex>
55using LockGuard = std::lock_guard<mutex>;
56
57template<typename... mutexes>
58using ScopedLock = std::scoped_lock<mutexes...>;
59
60}; // namespace Divide
61
62#endif //DVD_SHARED_MUTEX_BOOST_H_
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
std::lock_guard< mutex > LockGuard
Definition: SharedMutex.h:55
std::shared_timed_mutex SharedTimedMutex
Definition: SharedMutex.h:44
std::mutex Mutex
Definition: SharedMutex.h:40
std::shared_mutex SharedMutex
Definition: SharedMutex.h:43
std::unique_lock< mutex > UniqueLock
Definition: SharedMutex.h:52
std::shared_lock< mutex > SharedLock
Definition: SharedMutex.h:49
std::timed_mutex TimedMutex
Definition: SharedMutex.h:41
std::scoped_lock< mutexes... > ScopedLock
Definition: SharedMutex.h:58
std::recursive_mutex RecursiveMutex
Definition: SharedMutex.h:46