projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace stray tab with whitespace in guiFormSpecMenu.cpp (#9317)
[oweals/minetest.git]
/
src
/
util
/
thread.h
diff --git
a/src/util/thread.h
b/src/util/thread.h
index f54b8b48f25dfcbfa91002364d17d70bd77d00bb..73e9beb806f44d8effc6dd8e3a3bec3f82adf23f 100644
(file)
--- a/
src/util/thread.h
+++ b/
src/util/thread.h
@@
-17,13
+17,11
@@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
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"
#include "porting.h"
#include "log.h"
#include "container.h"
@@
-51,7
+49,7
@@
public:
// You pretty surely want to grab the lock when accessing this
T m_value;
private:
// You pretty surely want to grab the lock when accessing this
T m_value;
private:
-
M
utex m_mutex;
+
std::m
utex m_mutex;
};
/*
};
/*
@@
-80,11
+78,11
@@
public:
template<typename Key, typename T, typename Caller, typename CallerData>
class GetRequest {
public:
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;
}
Key key;
@@
-106,7
+104,7
@@
public:
return m_queue.empty();
}
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;
ResultQueue<Key, T, Caller, CallerData> *dest)
{
typename std::deque<GetRequest<Key, T, Caller, CallerData> >::iterator i;
@@
-191,7
+189,7
@@
class UpdateThread : public Thread
{
public:
UpdateThread(const std::string &name) : Thread(name + "Update") {}
{
public:
UpdateThread(const std::string &name) : Thread(name + "Update") {}
- ~UpdateThread()
{}
+ ~UpdateThread()
= default;
void deferUpdate() { m_update_sem.post(); }
void deferUpdate() { m_update_sem.post(); }
@@
-205,7
+203,6
@@
public:
void *run()
{
void *run()
{
- DSTACK(FUNCTION_NAME);
BEGIN_DEBUG_EXCEPTION_HANDLER
while (!stopRequested()) {
BEGIN_DEBUG_EXCEPTION_HANDLER
while (!stopRequested()) {
@@
-229,6
+226,3
@@
protected:
private:
Semaphore m_update_sem;
};
private:
Semaphore m_update_sem;
};
-
-#endif
-