thread/Mutex: make ScopeLock an alias for std::unique_lock
This commit is contained in:
		@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user