D22182: Remove anchorClicked lock which causes deadlock

Aaron Puchert noreply at phabricator.kde.org
Thu Jul 4 01:48:05 BST 2019


aaronpuchert added a comment.


  In D22182#489873 <https://phabricator.kde.org/D22182#489873>, @mswan wrote:
  
  > This should definitely be tried and I would be interested in the task. There is definitely quite alot of stuff that needs to be annotated to make this work so it might need several hands working on it.
  
  
  I'd be delighted and would happily work with you on this. I worked on the Thread Safety Analysis feature for a while.
  
  > The one problem with adopting that system in KDevelop is that we copy `DUChain::lock()` into each instance of `DUChain{Read,Write}Locker` which means that our annotations wouldn't see the `DUChainReadLocker` in one instance as the same lock in another instance.
  
  I don't think the lock is copied, it's just a pointer to it. That's not an issue, `std::lock_guard` does that as well. Note that `DUChainLock` would be annotated with `__attribute__((capability("mutex")))`, but `DUChainReadLocker` with `__attribute__((scoped_capability))`. The analysis tracks which scoped capability owns which capability.
  
  > Since I have never seen `DUChain{Read,Write}Locker` used with anything other than `DUChain::lock()`
  
  Wondered about this as well—the constructor allows specifying any lock, but this is used only with `DUChain::lock()`.
  
  > this shouldn't be cause for false positive deadlock detection.
  
  Deadlock detection needs to turned on separately anyway. (With `-Wthread-safety-negative`, because it requires "negative capabilities", i.e. someone not having a lock as opposed to having it.)
  
  I wouldn't worry too much about that for now.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D22182

To: mswan, #kdevelop
Cc: aaronpuchert, kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190704/cd250335/attachment-0001.html>


More information about the KDevelop-devel mailing list