1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Use C++11 mutexes only (remove compat code) (#5922)

* Fix event LINT & remove default constructor/destructors
* remove compat code & modernize autolock header
This commit is contained in:
Loïc Blot 2017-06-06 16:29:28 +02:00 committed by GitHub
parent 8bdde45895
commit d4c0f91275
36 changed files with 59 additions and 363 deletions

View file

@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "../irrlichttypes.h"
#include "../exceptions.h"
#include "../threading/mutex.h"
#include "../threading/mutex_auto_lock.h"
#include "../threading/semaphore.h"
#include <list>
@ -117,7 +116,7 @@ public:
private:
std::map<Key, Value> m_values;
mutable Mutex m_mutex;
mutable std::mutex m_mutex;
};
@ -225,12 +224,12 @@ public:
}
protected:
Mutex &getMutex() { return m_mutex; }
std::mutex &getMutex() { return m_mutex; }
std::deque<T> &getQueue() { return m_queue; }
std::deque<T> m_queue;
mutable Mutex m_mutex;
mutable std::mutex m_mutex;
Semaphore m_signal;
};

View file

@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "../irr_v2d.h"
#include "../irr_v3d.h"
#include "../irr_aabb3d.h"
#include "../threading/mutex.h"
#define rangelim(d, min, max) ((d) < (min) ? (min) : ((d) > (max) ? (max) : (d)))
#define myfloor(x) ((x) < 0.0 ? (int)(x) - 1 : (int)(x))

View file

@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "../irrlichttypes.h"
#include "../threading/thread.h"
#include "../threading/mutex.h"
#include "../threading/mutex_auto_lock.h"
#include "porting.h"
#include "log.h"
@ -51,7 +50,7 @@ public:
// You pretty surely want to grab the lock when accessing this
T m_value;
private:
Mutex m_mutex;
std::mutex m_mutex;
};
/*