[Kst] kst_concurrent_branch: kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Wed Feb 25 04:33:30 CET 2004
CVS commit by staikos:
locking fixes
M +2 -0 kstdoc.cpp 1.55.2.2
M +5 -3 kstiface_impl.cpp 1.16.2.2
M +16 -0 kstvcurve.cpp 1.25.2.2
--- kdeextragear-2/kst/kst/kstdoc.cpp #1.55.2.1:1.55.2.2
@@ -260,5 +260,7 @@ bool KstDoc::openDocument(const KURL &ur
i != KST::dataObjectList.end();
++i) {
+ (*i)->writeLock();
(*i)->loadInputs();
+ (*i)->writeUnlock();
}
KST::dataObjectList.lock().readUnlock();
--- kdeextragear-2/kst/kst/kstiface_impl.cpp #1.16.2.1:1.16.2.2
@@ -211,9 +211,10 @@ bool KstIfaceImpl::plotEquation(const QS
bool KstIfaceImpl::plotEquation(const QString& xvector, const QString& equation, const QString& plotName, const QColor& color) {
- KstReadLocker ml(&KST::vectorList.lock());
KstVectorPtr v;
KstPlot *plot = 0;
- KstVectorList::Iterator it = KST::vectorList.findTag(xvector);
QString etag, ptag;
+ KST::vectorList.lock().readLock();
+ KstVectorList::Iterator it = KST::vectorList.findTag(xvector);
+ KST::vectorList.lock().readUnlock();
if (equation.isEmpty() || it == KST::vectorList.end()) {
@@ -619,5 +620,4 @@ void KstIfaceImpl::reloadVector(const QS
const QString& KstIfaceImpl::loadVector(const QString& file, const QString& field) {
- KstReadLocker ml(&KST::vectorList.lock());
KstDataSourcePtr src;
/* generate or find the kstfile */
@@ -640,4 +640,5 @@ const QString& KstIfaceImpl::loadVector(
KST::dataSourceList.lock().writeUnlock();
+ KST::vectorList.lock().readLock();
QString vname = "V" + QString::number(KST::vectorList.count() + 1);
@@ -645,4 +646,5 @@ const QString& KstIfaceImpl::loadVector(
vname = "V" + QString::number(KST::vectorList.count() + 1);
}
+ KST::vectorList.lock().readUnlock();
KstVectorPtr p = new KstRVector(src, field, vname, 0, -1, 0, false, false);
--- kdeextragear-2/kst/kst/kstvcurve.cpp #1.25.2.1:1.25.2.2
@@ -120,5 +120,21 @@ void KstVCurve::loadInputs() {
}
+ VX->readLock();
+ VY->readLock();
+ if (EX) {
+ EX->readLock();
+ }
+ if (EY) {
+ EY->readLock();
+ }
update();
+ VX->readUnlock();
+ VY->readUnlock();
+ if (EX) {
+ EX->readUnlock();
+ }
+ if (EY) {
+ EY->readUnlock();
+ }
}
More information about the Kst
mailing list