Skip to content
Commit 5dbeef5f authored by Igor Kushnir's avatar Igor Kushnir
Browse files

ContextBrowserPlugin: remove redundant DUChain read locks

DUChain read locks are recursive, so this commit does not fix anything,
only improves performance. The removed locks were redundant because:
1. ContextBrowserPlugin::findDeclaration() is called only from
   ContextBrowserPlugin::updateForView() while holding DUChain::lock().
2. ContextBrowserPlugin::switchUse() acquires DUChain::lock() almost at
   the beginning => no need to acquire it again below.

Michael Swan originally proposed similar changes in
https://phabricator.kde.org/D22182 along with a fix for Bug 358787.
Jonathan L. Verner reinvented the same fix, but for Bug 416714, in the
parent of this commit. This commit modifies and applies the remaining
fixes from the Phabricator review.

The Phabricator review's summary contains:
  "There were two paths which needed a lock added given my change, so
  this change set should not cause any regression on bug #386901."
As explained at the top of this commit message, the moved/removed locks
were just redundant, and so removing them is unrelated to the bug fix.
parent a947074f
Pipeline #171397 passed with stage
in 22 minutes and 21 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment