From a595ba4fc75f4b966605912acec45b39b05e28c9 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 3 Aug 2010 14:26:54 +0000 Subject: [PATCH] Moved constructor of class bdThread from bdThreads.h to bdThreads.cc. Initialized member mTid of class RsThread too. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3338 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libbitdht/src/util/bdthreads.cc | 9 +++++++++ libbitdht/src/util/bdthreads.h | 9 +-------- libretroshare/src/util/rsthreads.cc | 6 ++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/libbitdht/src/util/bdthreads.cc b/libbitdht/src/util/bdthreads.cc index 2f008cca4..b4792429b 100644 --- a/libbitdht/src/util/bdthreads.cc +++ b/libbitdht/src/util/bdthreads.cc @@ -64,6 +64,15 @@ pthread_t createThread(bdThread &thread) } +bdThread::bdThread() +{ +#if defined(_WIN32) || defined(__MINGW32__) + memset (&mTid, 0, sizeof(mTid)); +#else + mTid = 0; +#endif +} + void bdThread::join() /* waits for the the mTid thread to stop */ { void *ptr; diff --git a/libbitdht/src/util/bdthreads.h b/libbitdht/src/util/bdthreads.h index ea4a2435f..a64ea6fa9 100644 --- a/libbitdht/src/util/bdthreads.h +++ b/libbitdht/src/util/bdthreads.h @@ -65,14 +65,7 @@ pthread_t createThread(bdThread &thread); class bdThread { public: - bdThread() - { -#if defined(_WIN32) || defined(__MINGW32__) - memset (&mTid, 0, sizeof(mTid)); -#else - mTid = 0; -#endif - } + bdThread(); virtual ~bdThread() { return; } virtual void start() { createThread(*this); } diff --git a/libretroshare/src/util/rsthreads.cc b/libretroshare/src/util/rsthreads.cc index 984a4bae9..25a511df1 100644 --- a/libretroshare/src/util/rsthreads.cc +++ b/libretroshare/src/util/rsthreads.cc @@ -83,6 +83,12 @@ pthread_t createThread(RsThread &thread) RsThread::RsThread () { m_bRun = true; + +#ifdef WINDOWS_SYS + memset (&mTid, 0, sizeof(mTid)); +#else + mTid = 0; +#endif } void RsThread::join() /* waits for the the mTid thread to stop */