qt6-bb10/examples/corelib
Giuseppe D'Angelo fddeec60cb Wait conditions example: fix an incorrect condition variable usage
3a449bbb69 amended the code to remove
acquiring a lock when waking up a condition variable. It is fine to
not have a lock associated when waking a condition variable; what I
misunderstood was the scope of the lock, which (and this underlines
the importance of commenting _what exactly_ a lock protects, for
each and ever lock) protected both the buffer as well as the counter
of the buffer. This made my reasoning flawed: it is necessary to keep
the lock while notifying, otherwise the counterpart could verify the
condition isn't satisfied and wait (e.g. see numUsedBytes==0), missing
the wake from the other thread (which could arrive between the check and
the wait).

Amends the previous commit.

Change-Id: If7db2d045331f1b33b976fb6bf6aa9117c41678f
Pick-to: 5.15 6.2 6.4 6.5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-12-28 15:10:40 +01:00
..
bindableproperties Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
ipc Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
mimetypes Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
permissions Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
platform Examples: Use qt_standard_project_setup() 2022-11-17 19:59:11 +01:00
serialization Use const reference in loop in JSON Save Game example 2022-12-05 19:02:59 +01:00
threads Wait conditions example: fix an incorrect condition variable usage 2022-12-28 15:10:40 +01:00
tools Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
CMakeLists.txt Add permissions feature example and manual test to the build 2022-11-10 17:54:02 +02:00
corelib.pro Move notification example from androidextras to qtbase 2021-06-04 22:21:12 +03:00