[Kst] branches/work/kst/hierarchy/kst/src/libkst
Eli Fidler
eli at staikos.net
Tue Nov 21 17:37:31 CET 2006
SVN commit 606758 by fidler:
locking
M +4 -1 kstobject.h
M +5 -0 kstscalar.cpp
M +4 -0 kststring.cpp
--- branches/work/kst/hierarchy/kst/src/libkst/kstobject.h #606757:606758
@@ -336,7 +336,6 @@
KstObjectTreeNode *addDescendant(KstObject *o, KstObjectNameIndex *index = NULL);
bool removeDescendant(KstObject *o, KstObjectNameIndex *index = NULL);
- // TODO: locking
private:
QString _tag;
QGuardedPtr<KstObject> _object;
@@ -352,7 +351,11 @@
KstObject *retrieveObject(QStringList tag);
KstObject *retrieveObject(KstObjectTag tag);
+ KstRWLock& lock() const { return _lock; }
+
private:
+ mutable KstRWLock _lock;
+
KstObjectTreeNode _root;
KstObjectNameIndex _index;
};
--- branches/work/kst/hierarchy/kst/src/libkst/kstscalar.cpp #606757:606758
@@ -97,6 +97,9 @@
KstScalar::~KstScalar() {
+ KstWriteLocker l(&KST::scalarNameTree.lock());
+
+ KST::scalarNameTree.removeObject(this);
}
@@ -197,6 +200,8 @@
void KstScalar::setTagName(KstObjectTag newTag) {
+ KstWriteLocker l(&KST::scalarNameTree.lock());
+
KST::scalarNameTree.removeObject(this);
KstObject::setTagName(newTag);
KST::scalarNameTree.addObject(this);
--- branches/work/kst/hierarchy/kst/src/libkst/kststring.cpp #606757:606758
@@ -71,10 +71,14 @@
KstString::~KstString() {
+ KstWriteLocker l(&KST::stringNameTree.lock());
+ KST::stringNameTree.removeObject(this);
}
void KstString::setTagName(KstObjectTag tag) {
+ KstWriteLocker l(&KST::stringNameTree.lock());
+
KST::stringNameTree.removeObject(this);
KstObject::setTagName(tag);
KST::stringNameTree.addObject(this);
More information about the Kst
mailing list