51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef UTIL_THREAD_HEADER
-#define UTIL_THREAD_HEADER
+#pragma once
-#include "../irrlichttypes.h"
-#include "../threading/thread.h"
-#include "../threading/mutex.h"
-#include "../threading/mutex_auto_lock.h"
+#include "irrlichttypes.h"
+#include "threading/thread.h"
+#include "threading/mutex_auto_lock.h"
#include "porting.h"
#include "log.h"
#include "container.h"
// You pretty surely want to grab the lock when accessing this
T m_value;
private:
- Mutex m_mutex;
+ std::mutex m_mutex;
};
/*
template<typename Key, typename T, typename Caller, typename CallerData>
class GetRequest {
public:
- GetRequest() {}
- ~GetRequest() {}
+ GetRequest() = default;
+ ~GetRequest() = default;
- GetRequest(Key a_key) {
- key = a_key;
+ GetRequest(const Key &a_key): key(a_key)
+ {
}
Key key;
return m_queue.empty();
}
- void add(Key key, Caller caller, CallerData callerdata,
+ void add(const Key &key, Caller caller, CallerData callerdata,
ResultQueue<Key, T, Caller, CallerData> *dest)
{
typename std::deque<GetRequest<Key, T, Caller, CallerData> >::iterator i;
{
public:
UpdateThread(const std::string &name) : Thread(name + "Update") {}
- ~UpdateThread() {}
+ ~UpdateThread() = default;
void deferUpdate() { m_update_sem.post(); }
void *run()
{
- DSTACK(FUNCTION_NAME);
BEGIN_DEBUG_EXCEPTION_HANDLER
while (!stopRequested()) {
private:
Semaphore m_update_sem;
};
-
-#endif
-