Dictionary Engine: fix synchronization issues.

Authored by dfaure on Oct 15 2017, 9:25 PM.

Description

Dictionary Engine: fix synchronization issues.

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.

Reviewers: Plasma, mart

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D8320

Details

Committed
dfaureOct 22 2017, 11:45 AM
Differential Revision
D8320: Dictionary Engine: fix synchronization issues.
Parents
R114:11b4a56bf2a6: SVN_SILENT made messages (.desktop file) - always resolve ours
Branches
Unknown
Tags
Unknown