D8320: Dictionary Engine: fix synchronization issues.

David Faure noreply at phabricator.kde.org
Sun Oct 15 21:32:34 UTC 2017


dfaure created this revision.
dfaure added reviewers: Plasma, mart.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.

REVISION SUMMARY
  QMutex isn't the right tool for this:
  
  - If tryLock succeeds, the code didn't unlock the mutex again, leading
  
  to the runtime warning "QMutex: destroying locked mutex"
  
  - But if we add "else data.mutex.unlock()" then we risk that the other thread also
  
  calls unlock(), on a now-unlocked mutex, which is undefined behaviour.
  
  QWaitCondition is the right tool for waiting for something to happen,
  allowing us to unlock the mutex correctly in all cases.

TEST PLAN
  Alt+F2 "define test". Doesn't seem to work very reliably yet, though.

REPOSITORY
  R114 Plasma Addons

BRANCH
  Plasma/5.11

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

AFFECTED FILES
  runners/dictionary/dictionarymatchengine.cpp
  runners/dictionary/dictionarymatchengine.h

To: dfaure, #plasma, mart
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171015/4b05828c/attachment.html>


More information about the Plasma-devel mailing list