comparison transform/TransformFactory.cpp @ 482:f54381e01141

* Fix a deadlock * Make debug output more suited to datastore rdf implementation
author Chris Cannam
date Fri, 14 Nov 2008 12:29:48 +0000
parents a82645e788fc
children 45ded09e4710
comparison
equal deleted inserted replaced
481:a82645e788fc 482:f54381e01141
61 } 61 }
62 62
63 void 63 void
64 TransformFactory::startPopulationThread() 64 TransformFactory::startPopulationThread()
65 { 65 {
66 MutexLocker locker(&m_uninstalledTransformsMutex, 66 m_uninstalledTransformsMutex.lock();
67 "TransformFactory::startPopulationThread"); 67
68 68 if (m_thread) {
69 if (m_thread) return; 69 m_uninstalledTransformsMutex.unlock();
70 70 return;
71 }
71 m_thread = new UninstalledTransformsPopulateThread(this); 72 m_thread = new UninstalledTransformsPopulateThread(this);
73
74 m_uninstalledTransformsMutex.unlock();
75
72 m_thread->start(); 76 m_thread->start();
73 } 77 }
74 78
75 void 79 void
76 TransformFactory::UninstalledTransformsPopulateThread::run() 80 TransformFactory::UninstalledTransformsPopulateThread::run()
171 populateUninstalledTransforms(); 175 populateUninstalledTransforms();
172 m_uninstalledTransformsMutex.lock(); 176 m_uninstalledTransformsMutex.lock();
173 } 177 }
174 178
175 if (m_uninstalledTransforms.find(id) != m_uninstalledTransforms.end()) { 179 if (m_uninstalledTransforms.find(id) != m_uninstalledTransforms.end()) {
180 m_uninstalledTransformsMutex.unlock();
176 return TransformNotInstalled; 181 return TransformNotInstalled;
177 } 182 }
178 183
179 m_uninstalledTransformsMutex.unlock(); 184 m_uninstalledTransformsMutex.unlock();
180
181 return TransformUnknown; 185 return TransformUnknown;
182 } 186 }
183 187
184 188
185 std::vector<QString> 189 std::vector<QString>