DIY 3.0 data-parallel out-of-core C++ library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List

All Classes Namespaces Functions Typedefs Groups Pages
thread.hpp
1 #ifndef DIY_THREAD_H
2 #define DIY_THREAD_H
3
4 #ifdef DIY_NO_THREADS
5 #include "no-thread.hpp"
6 #else
7
8 #include "thread/fast_mutex.h"
9
10 #include <thread>
11 #include <mutex>
12
13 namespace diy
14 {
15 using std::thread;
16 using std::mutex;
17 using std::recursive_mutex;
18 namespace this_thread = std::this_thread;
19
20 // TODO: replace with our own implementation using std::atomic_flag
21 using fast_mutex = tthread::fast_mutex;
22
23 template<class Mutex>
24 using lock_guard = std::unique_lock<Mutex>;
25 }
26
27 #endif
28
29 #include "critical-resource.hpp"
30
31 #endif