qt5base-lts/examples
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
..
aggregate install a sane top-level examples.pro file 2012-12-11 13:37:57 +01:00
corelib Wait conditions example: fix an incorrect condition variable usage 2022-12-28 15:10:40 +01:00
dbus Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
embedded examples: port embedded examples to new connection style 2022-12-21 21:52:17 +01:00
gui Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
network examples: port network examples to new connection style 2022-12-21 21:52:17 +01:00
opengl Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
qmake examples: port qmake examples to new connection style 2022-12-21 22:52:17 +02:00
qpa examples: port qpa examples to new connection style 2022-12-21 21:52:17 +01:00
qtconcurrent Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
qtestlib Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
sql Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
vulkan Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
widgets wiggly example: add support for emojis etc. (utf16 surrogate pairs) 2022-12-12 12:33:20 +01:00
xml examples: port xml examples to new connection style 2022-12-21 22:33:02 +01:00
CMakeLists.txt Examples: Use Qt6:: to qualify Qt CMake packages 2022-11-17 19:59:11 +01:00
examples.pro Turn off the dbus examples for qmake-generated VS projects 2021-02-09 15:45:06 +01:00
README Remove more references to demos. 2011-07-08 15:36:26 +02:00

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.