Add `volatile` specifier for the mapped memory area pointer to give 43/278743/2
authorAdam Michalski <a.michalski2@partner.samsung.com>
Mon, 25 Jul 2022 14:50:48 +0000 (16:50 +0200)
committerAdam Michalski <a.michalski2@partner.samsung.com>
Wed, 10 Aug 2022 12:16:00 +0000 (14:16 +0200)
commitc1ce626859d650a9274f4e9df56aad30edfdfb03
treeb4ead8d51663671578c926381b078799034b9302
parentf584d59335ae3de01237ab406a0c67f1dbc6224e
Add `volatile` specifier for the mapped memory area pointer to give
a hint to the compiler that it cannot optimize any checks to it

Without this hint the compiler tends to optimize the synchronization
barrier as it thinks that if a variable is unchanged in the parent
process, it can optimize access to it and not perform the check each
time during the `while` loop which leads to deadlock (endless waiting).

Change-Id: I0a316b4e0d1546bc6864737c20c86601635fff2a
benchmark/gdbus.c
benchmark/libdbus.c
benchmark/pipe.c
benchmark/socket.c