mutex_protected: Add operator ++ and --
This commit is contained in:
@@ -57,6 +57,16 @@ class mutex_protected : public boost::noncopyable {
|
|||||||
value_ = value;
|
value_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void operator++() {
|
||||||
|
QMutexLocker l(&mutex_);
|
||||||
|
++value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator--() {
|
||||||
|
QMutexLocker l(&mutex_);
|
||||||
|
--value_;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T value_;
|
T value_;
|
||||||
mutable QMutex mutex_;
|
mutable QMutex mutex_;
|
||||||
|
|||||||
Reference in New Issue
Block a user