Skip to content
Commit 02d8fbfb authored by David Faure's avatar David Faure
Browse files

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
parent 11b4a56b
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