[qet] [1334] Added a mutex to avoid loading a collection twice at the same time.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1334
Author:   xavier
Date:     2011-09-20 19:49:17 +0200 (Tue, 20 Sep 2011)
Log Message:
-----------
Added a mutex to avoid loading a collection twice at the same time.

Modified Paths:
--------------
    branches/0.3/sources/fileelementscollection.cpp
    branches/0.3/sources/fileelementscollection.h

Modified: branches/0.3/sources/fileelementscollection.cpp
===================================================================
--- branches/0.3/sources/fileelementscollection.cpp	2011-09-20 14:24:39 UTC (rev 1333)
+++ branches/0.3/sources/fileelementscollection.cpp	2011-09-20 17:49:17 UTC (rev 1334)
@@ -51,6 +51,7 @@
 	Recharge l'arborescence des categories et elements.
 */
 void FileElementsCollection::reload() {
+	QMutexLocker reload_lock(&reload_mutex_);
 	// oublie l'arborescence precedente
 	deleteContent();
 	

Modified: branches/0.3/sources/fileelementscollection.h
===================================================================
--- branches/0.3/sources/fileelementscollection.h	2011-09-20 14:24:39 UTC (rev 1333)
+++ branches/0.3/sources/fileelementscollection.h	2011-09-20 17:49:17 UTC (rev 1334)
@@ -57,5 +57,6 @@
 	private:
 	QString coll_path;
 	FileElementsCategory *root;
+	QMutex reload_mutex_;       ///< Mutex used to avoid loading a collection twice at the same time
 };
 #endif


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/