In no particular order: * Clean up #includes. * Document what is protected by the mutex. * Use explicit, nullptr. * Use lock managers, not manual calls to lock/unlock. * Unlock the mutex before notifying the condition variables. * Condition variables are always meant to be used in a while loop, and never with a plain if, because of spurious wakeups. * Don't lock a mutex just to protect a plain integer. We have atomics for that use case. * Remove an unneeded signal, therefore also the need of using Q_OBJECT and the inclusion of the moc-generated file. Pick-to: 5.15 6.2 6.4 Fixes: QTBUG-108860 Change-Id: I2afc77955b95de8aa5fb88048cd9feb217f83b4f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> |
||
|---|---|---|
| .. | ||
| doc | ||
| mandelbrot | ||
| queuedcustomtype | ||
| semaphores | ||
| waitconditions | ||
| CMakeLists.txt | ||
| README | ||
| threads.pro | ||
README
This folder contains examples for the use of the threading-related classes in Qt Core. For examples using the higher-level Qt Concurrent module, check out the "qtconcurrent" folder instead. Documentation for examples can be found via the Examples and Tutorials link in the main Qt documentation. The examples and their documentation can also be opened from the Examples tab of Qt Creator's Welcome mode.