qt6-bb10/examples/corelib/threads/waitconditions
Giuseppe D'Angelo 3a449bbb69 Wait conditions example: code tidies
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>
2022-12-06 06:30:55 +01:00
..
CMakeLists.txt Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
waitconditions.cpp Wait conditions example: code tidies 2022-12-06 06:30:55 +01:00
waitconditions.pro Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00