projects
/
invirt/third/libt4.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
00d437473ee44283865a4cb72fd30f7b38297282
[invirt/third/libt4.git]
/
lock.h
1
#ifndef lock_h
2
#define lock_h
3
4
#include <thread>
5
#include <mutex>
6
7
using std::mutex;
8
using lock = std::unique_lock<std::mutex>;
9
10
class adopt_lock : public lock {
11
public:
12
inline adopt_lock(class mutex &m) : std::unique_lock<std::mutex>(m, std::adopt_lock) {
13
}
14
inline ~adopt_lock() {
15
release();
16
}
17
};
18
19
#endif