]> git.lyx.org Git - features.git/commitdiff
Remove questionable Mutex copy code
authorGeorg Baum <baum@lyx.org>
Tue, 8 Oct 2013 20:06:55 +0000 (22:06 +0200)
committerGeorg Baum <baum@lyx.org>
Tue, 8 Oct 2013 20:06:55 +0000 (22:06 +0200)
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
src/support/mutex.h

index 042c9b88cd172fe54110b30c782a11752b469601..9f3babda27a5508f07346aa802995bc6facb9687 100644 (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();
index ed3954f03f5a0bce02737a11308ba74fb9192e75..5f34f7de514f3161d27ba3d6682b114e54a07a20 100644 (file)
@@ -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;