Foreground Lock attempt hanging during code completion
zwabel at googlemail.com
Wed Aug 10 19:27:07 UTC 2011
Hmm looking at the backtrace, the whole thing still isn't safe:
completionItems() is called recursively, and at the top of the first
call, the duchain is locked. Therefore, the duchain is locked while
you acquire the foreground lock, and you probably deadlock with some
other parsing thread.
Do you even need the "case" completion in the parentContext() (eg. in
argument hints)? Otherwise, you could simply only do the case stuff
when "depth() == 0", in that case you're safe. Ah yeah, and as first,
I would add an "ENSURE_CHAIN_NOT_LOCKED" at the top of
switchExpressionType. This will reveal such problems much faster.
More information about the KDevelop-devel