Remove questionable Mutex copy code

It is no longer needed, and it had a comment that it needed review...
Now anybody who tries to make a copy again is forced to think about it,
instead of trying and using possibly wrong semantics by accident.
This commit is contained in:
Georg Baum 2013-10-08 22:06:55 +02:00
parent f50550c4b9
commit 3e83380350
2 changed files with 3 additions and 22 deletions

View File

@ -40,22 +40,6 @@ Mutex::~Mutex()
}
// It makes no sense to copy the mutex,
// each instance has its own QMutex,
// therefore nothing to copy!
// TODO review
Mutex::Mutex(const Mutex&) : d(new Private)
{
}
Mutex& Mutex::operator=(const Mutex&)
{
return *this;
}
Mutex::Locker::Locker(Mutex* mtx) : mutex_(mtx)
{
mutex_->d->qmutex_.lock();

View File

@ -21,6 +21,9 @@ namespace lyx {
class Mutex
{
/// noncopyable
Mutex(const Mutex&);
Mutex& operator=(const Mutex&);
public:
Mutex();
~Mutex();
@ -46,12 +49,6 @@ public:
Mutex* mutex_;
};
// pseude-value semantic
// needed by GuiPrefs which makes a copy
Mutex(const Mutex&);
Mutex& operator=(const Mutex&);
private:
struct Private;
Private* d;