mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Fix C++11 compilability
Previous commits broke it... :(
This commit is contained in:
parent
0459eca8eb
commit
e50c784e2c
7 changed files with 43 additions and 5 deletions
|
@ -28,7 +28,8 @@ DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#if __cplusplus >= 201103L
|
||||
#include <mutex>
|
||||
using MutexAutoLock = std::lock_guard<std::mutex>;
|
||||
using MutexAutoLock = std::unique_lock<std::mutex>;
|
||||
using RecursiveMutexAutoLock = std::unique_lock<std::recursive_mutex>;
|
||||
#else
|
||||
|
||||
#include "threading/mutex.h"
|
||||
|
@ -44,6 +45,15 @@ private:
|
|||
Mutex &mutex;
|
||||
};
|
||||
|
||||
class RecursiveMutexAutoLock
|
||||
{
|
||||
public:
|
||||
RecursiveMutexAutoLock(RecursiveMutex &m) : mutex(m) { mutex.lock(); }
|
||||
~RecursiveMutexAutoLock() { mutex.unlock(); }
|
||||
|
||||
private:
|
||||
RecursiveMutex &mutex;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue