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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2014-08-06 14:19:38 +02:00
parent e97a3ce9d0
commit d128b41844

View File

@@ -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 {