[Kst] kst_hfi_calib_branch: kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Nov 17 22:00:55 CET 2004


CVS commit by staikos: 

port of the deadlock fix from HEAD


  M +9 -3      kstdatacollection-gui.cpp   1.9.2.1


--- kdeextragear-2/kst/kst/kstdatacollection-gui.cpp  #1.9:1.9.2.1
@@ -39,6 +39,7 @@ bool KST::dataTagNameNotUnique(const QSt
 
   /* verify that the tag name is not used by a data object */
-  KstReadLocker ml(&KST::dataObjectList.lock());
+  KST::dataObjectList.lock().readLock();
   if (KST::dataObjectList.findTag(tag) != KST::dataObjectList.end()) {
+    KST::dataObjectList.lock().readUnlock();
       if (warn) {
         KMessageBox::sorry(static_cast<QWidget*>(p), i18n("%1: this name is already in use. Change it to a unique name.").arg(tag));
@@ -46,4 +47,5 @@ bool KST::dataTagNameNotUnique(const QSt
       return true;
   }
+  KST::dataObjectList.lock().readUnlock();
 
   return false;
@@ -60,8 +62,10 @@ bool KST::vectorTagNameNotUnique(const Q
 
   /* verify that the tag name is not used by a data object */
-  KstReadLocker ml(&KST::vectorList.lock());
-  KstReadLocker ml2(&KST::scalarList.lock());
+  KST::vectorList.lock().readLock();
+  KST::scalarList.lock().readLock();
   if (KST::vectorList.findTag(tag) != KST::vectorList.end() ||
       KST::scalarList.findTag(tag) != KST::scalarList.end()) {
+    KST::scalarList.lock().readUnlock();
+    KST::vectorList.lock().readUnlock();
       if (warn) {
         KMessageBox::sorry(static_cast<QWidget*>(p), i18n("%1: this name is already in use. Change it to a unique name.").arg(tag));
@@ -70,4 +74,6 @@ bool KST::vectorTagNameNotUnique(const Q
   }
 
+  KST::scalarList.lock().readUnlock();
+  KST::vectorList.lock().readUnlock();
   return false;
 }





More information about the Kst mailing list