From: Georg Baum Date: Tue, 8 Oct 2013 20:06:55 +0000 (+0200) Subject: Remove questionable Mutex copy code X-Git-Tag: 2.1.0beta2~31 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3e833803502eb7235d679a35a59113a0737e2ea2;p=lyx.git 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. --- diff --git a/src/support/mutex.cpp b/src/support/mutex.cpp index 042c9b88cd..9f3babda27 100644 --- a/src/support/mutex.cpp +++ b/src/support/mutex.cpp @@ -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(); diff --git a/src/support/mutex.h b/src/support/mutex.h index ed3954f03f..5f34f7de51 100644 --- a/src/support/mutex.h +++ b/src/support/mutex.h @@ -21,6 +21,9 @@ namespace lyx { class Mutex { + /// noncopyable + Mutex(const Mutex&); + Mutex& operator=(const Mutex&); public: Mutex(); ~Mutex(); @@ -45,12 +48,6 @@ public: Locker& operator=(const Locker& rhs); Mutex* mutex_; }; - - - // pseude-value semantic - // needed by GuiPrefs which makes a copy - Mutex(const Mutex&); - Mutex& operator=(const Mutex&); private: struct Private;