diff options
author | Vincent Glize <vincentglize@hotmail.fr> | 2017-06-19 23:54:58 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-19 23:54:58 +0200 |
commit | 4a5e8ad343079f6552fab639770e5771ed7c4e7a (patch) | |
tree | eeab3adec1fc3e7a3b06d9f53b92ab99a5e0d290 /src/threading | |
parent | 4a789490834157baa8788a2f36c95b86c1e4440e (diff) | |
download | hax-minetest-server-4a5e8ad343079f6552fab639770e5771ed7c4e7a.tar.gz hax-minetest-server-4a5e8ad343079f6552fab639770e5771ed7c4e7a.zip |
C++11 cleanup on constructors (#6000)
* C++11 cleanup on constructors dir script
Diffstat (limited to 'src/threading')
-rw-r--r-- | src/threading/thread.cpp | 6 | ||||
-rw-r--r-- | src/threading/thread.h | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/threading/thread.cpp b/src/threading/thread.cpp index cc4d65656..8f54fb762 100644 --- a/src/threading/thread.cpp +++ b/src/threading/thread.cpp @@ -60,8 +60,6 @@ DEALINGS IN THE SOFTWARE. Thread::Thread(const std::string &name) : m_name(name), - m_retval(NULL), - m_joinable(false), m_request_stop(false), m_running(false) { @@ -130,7 +128,7 @@ bool Thread::wait() m_thread_obj->join(); delete m_thread_obj; - m_thread_obj = NULL; + m_thread_obj = nullptr; assert(m_running == false); m_joinable = false; @@ -162,7 +160,7 @@ bool Thread::kill() wait(); #endif - m_retval = NULL; + m_retval = nullptr; m_joinable = false; m_request_stop = false; diff --git a/src/threading/thread.h b/src/threading/thread.h index 284c8e46c..dab5d0ec7 100644 --- a/src/threading/thread.h +++ b/src/threading/thread.h @@ -145,8 +145,8 @@ private: static void threadProc(Thread *thr); - void *m_retval; - bool m_joinable; + void *m_retval = nullptr; + bool m_joinable = false; std::atomic<bool> m_request_stop; std::atomic<bool> m_running; std::mutex m_mutex; |