From 964be640cb1072b122e5047ddfed19907c6b9dab Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 17 Oct 2015 22:42:48 -0400 Subject: Fix some threading things and add additional thread unittests - Fix thread name reset on start() - Fully reset thread state on kill() - Add unittests to check for correct object states under various circumstances --- src/threading/thread.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/threading/thread.h') diff --git a/src/threading/thread.h b/src/threading/thread.h index cd46856e9..3d85e0eb9 100644 --- a/src/threading/thread.h +++ b/src/threading/thread.h @@ -81,9 +81,10 @@ public: /* * Waits for thread to finish. * Note: This does not stop a thread, you have to do this on your own. - * Returns immediately if the thread is not started. + * Returns false immediately if the thread is not started or has been waited + * on before. */ - void wait(); + bool wait(); /* * Returns true if the calling thread is this Thread object. @@ -140,15 +141,14 @@ protected: private: void *m_retval; + bool m_joinable; Atomic m_request_stop; Atomic m_running; - Mutex m_continue_mutex; + Mutex m_mutex; threadid_t m_thread_id; threadhandle_t m_thread_handle; - void cleanup(); - static ThreadStartFunc threadProc; #ifdef _AIX -- cgit v1.2.3