Hi all,<br><br>I'm currently running some race conditions when calling IProject::projectItem() and IBuildSystemManager::includeDirectories()<br>from different simultaneous threads, in controlglowgraph plugin.<br><br>I added a mutex to serialize these calls and apparently crashes were solved:<br>
<br> KDevelop::ProjectBaseItem *project_item = 0;<br> {<br> QMutexLocker locker (&mutex);<br> if (m_currentProject)<br> project_item = m_currentProject->projectItem();<br>
}<br><br> KUrl::List list;<br> {<br> QMutexLocker locker (&mutex);<br> list = buildSystemManager->includeDirectories( project_item );<br> }<br>
<br>So, are really these methods not thread-safe ? Is there a better solution than using QMutex ?<br>Which kdevplatform methods should I consider not thread-safe ? I'm trying the keep the lock at a<br>minimum code range but I'm afraid of others not thread-safe methods which, just being lucky,<br>
don't caused yet a crash.<br><br>Thanks,<br clear="all">Sandro<br>