From d128b418449e53e42d45db8d45321b324c67ff6e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 6 Aug 2014 14:19:38 +0200 Subject: [PATCH] Threads: Add some undefined constructors etc This is needed to "get rid" of the C++ default implementation. Yes, I know that this can be done way nicer with C++11... Signed-off-by: Uli Schlachter --- include/znc/Threads.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/znc/Threads.h b/include/znc/Threads.h index ace1ca0a..cdae9ffe 100644 --- a/include/znc/Threads.h +++ b/include/znc/Threads.h @@ -71,6 +71,10 @@ public: } private: + // Undefined copy constructor and assignment operator + CMutex(const CMutex&); + CMutex& operator=(const CMutex&); + pthread_mutex_t m_mutex; }; @@ -105,6 +109,10 @@ public: } private: + // Undefined copy constructor and assignment operator + CMutexLocker(const CMutexLocker&); + CMutexLocker& operator=(const CMutexLocker&); + CMutex &m_mutex; bool m_locked; }; @@ -161,6 +169,10 @@ public: } private: + // Undefined copy constructor and assignment operator + CConditionVariable(const CConditionVariable&); + CConditionVariable& operator=(const CConditionVariable&); + pthread_cond_t m_cond; }; @@ -185,6 +197,10 @@ public: exit(1); } } + +private: + // Undefined constructor + CThread(); }; class CJob { @@ -192,6 +208,11 @@ public: virtual ~CJob() {} virtual void runThread() = 0; virtual void runMain() = 0; + +private: + // Undefined copy constructor and assignment operator + CJob(const CJob&); + CJob& operator=(const CJob&); }; class CThreadPool {