From 3e833803502eb7235d679a35a59113a0737e2ea2 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 8 Oct 2013 22:06:55 +0200 Subject: [PATCH] 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. --- src/support/mutex.cpp | 16 ---------------- src/support/mutex.h | 9 +++------ 2 files changed, 3 insertions(+), 22 deletions(-) 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; -- 2.39.5