Ensure we never access a given CXTranslationUnit concurrently.

Review Request #118817 - Created June 18, 2014 and submitted

Information
Milian Wolff
kdev-clang
master
Reviewers
kdevelop
kfunk, olivierjg
Ensure we never access a given CXTranslationUnit concurrently.

ParseSession's data is moved into ParseSessionData, which is the
actual IAstContainer implementation. It also now stores a QMutex.
This mutex is implicitly locked inside ParseSession, so you can say
a ParseSession is now similar to a QMutexLocker, with the difference
that you can exchange the QMutex it operates on. This simplifies the
code in the parse job in my opinion.

The other places where the ParseSession was used are adapted to
operate on the value type instead of the pointer, where appropriate.

This patch hopefully fixes the assertions we currently trigger in LLVM
debug builds. Further optimizations, to e.g. enable concurrent
read-access, can be investigated later on. I'm not really sure it's
going to be worth the effort though...
Tests pass and manual testing on a small project seems to work fine as well. I don't have a debug build of llvm though, so if anyone could test that it would be appreciated.
Kevin Funk
Commit Hook
Milian Wolff
Review request changed

Status: Closed (submitted)

Loading...