thread/Mutex: make ScopeLock an alias for std::unique_lock
This commit is contained in:
parent
9c11184238
commit
6fc47fbb69
@ -44,16 +44,7 @@ class Mutex : public PosixMutex {};
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class ScopeLock {
|
using ScopeLock = std::unique_lock<Mutex>;
|
||||||
std::unique_lock<Mutex> lock;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ScopeLock(Mutex &_mutex):lock(_mutex) {}
|
|
||||||
|
|
||||||
void Unlock() {
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Within the scope of an instance, this class will keep a #Mutex
|
* Within the scope of an instance, this class will keep a #Mutex
|
||||||
|
Loading…
Reference in New Issue
Block a user