mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pod: fix some data races in body code
The body code didn't use atomic loads, so it had undefined behavior if the body was concurrently modified. Use atomic loads to fix this. Since the memory order is __ATOMIC_RELAXED this has no runtime overhead. Also add barriers around a strncpy call and cast to volatile before checking for a NUL terminator, though NUL-terminated strings in shared memory are unuseable. There are some places where bytewise atomic memcpy(), which doesn't currently exist, is needed. Instead, try to fake it by using two barriers around memcpy().
This commit is contained in:
parent
c9c7552fed
commit
bac3d31283
3 changed files with 45 additions and 17 deletions
|
|
@ -4,7 +4,7 @@ project('pipewire', ['c' ],
|
|||
meson_version : '>= 0.61.1',
|
||||
default_options : [ 'warning_level=3',
|
||||
'c_std=gnu11',
|
||||
'cpp_std=c++17',
|
||||
'cpp_std=c++20',
|
||||
'b_pie=true',
|
||||
#'b_sanitize=address,undefined',
|
||||
'buildtype=debugoptimized' ])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue