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.
}
-// 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();
class Mutex
{
+ /// noncopyable
+ Mutex(const Mutex&);
+ Mutex& operator=(const Mutex&);
public:
Mutex();
~Mutex();
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;