Summary: | deadlock on exit with specific file | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | George Staikos <staikos> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | grave | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
George Staikos
2006-10-06 04:19:24 UTC
SVN commit 592888 by staikos: Remove some deadlock cases BUG: 135171 BUG: 135176 M +15 -12 kstdoc.cpp M +5 -3 updatethread.cpp --- trunk/extragear/graphics/kst/src/libkstapp/kstdoc.cpp #592887:592888 @@ -792,14 +792,25 @@ } } + KST::dataObjectList.lock().writeLock(); + // Avoid deadlock in DataObject destructor + KstDataObjectList tmpDol = QDeepCopy<KstDataObjectList>(KST::dataObjectList); + KST::dataObjectList.clear(); + KST::dataObjectList.lock().unlock(); + tmpDol.clear(); + + KST::dataSourceList.lock().writeLock(); + KST::dataSourceList.clear(); + KST::dataSourceList.lock().unlock(); + + KST::matrixList.lock().writeLock(); + KST::matrixList.clear(); + KST::matrixList.lock().unlock(); + KST::vectorList.lock().writeLock(); KST::vectorList.clear(); KST::vectorList.lock().unlock(); - KST::matrixList.lock().writeLock(); - KST::matrixList.clear(); - KST::matrixList.lock().unlock(); - KST::scalarList.lock().writeLock(); KST::scalarList.clear(); KST::scalarList.lock().unlock(); @@ -808,14 +819,6 @@ KST::stringList.clear(); KST::stringList.lock().unlock(); - KST::dataSourceList.lock().writeLock(); - KST::dataSourceList.clear(); - KST::dataSourceList.lock().unlock(); - - KST::dataObjectList.lock().writeLock(); - KST::dataObjectList.clear(); - KST::dataObjectList.lock().unlock(); - emit updateDialogs(); } --- trunk/extragear/graphics/kst/src/libkstapp/updatethread.cpp #592887:592888 @@ -19,6 +19,8 @@ #include <assert.h> +#include <qdeepcopy.h> + #include "ksdebug.h" #include "kstdatacollection.h" @@ -234,7 +236,9 @@ KstScalar::clearScalarsDirty(); // Must do this first and take a risk of // falling slightly behind KST::scalarList.lock().readLock(); - for (KstScalarList::ConstIterator i = KST::scalarList.begin(); i != KST::scalarList.end(); ++i) { + KstScalarList sl = QDeepCopy<KstScalarList>(KST::scalarList); // avoid deadlock on exit + KST::scalarList.lock().unlock(); + for (KstScalarList::ConstIterator i = sl.begin(); i != sl.end(); ++i) { KstScalarPtr sp = *i; sp->writeLock(); @@ -246,11 +250,9 @@ } if (_done) { - KST::scalarList.lock().unlock(); return false; } } - KST::scalarList.lock().unlock(); } if (U == KstObject::UPDATE) { Change version to 1.x |