pipewire/pipewire-jack/src
Wim Taymans 2a4222a538 jack: fix race in get_buffer_output()
When a single output port is linked to multiple input ports of the same
client and the client uses multiple threads to process the input ports,
get_buffer_output() is called from multiple threads concurrently and
causes a race.

Multiple threads will try to dequeue a buffer concurrently and set the
HAVE_DATA io status, which causes the port to run out of buffers quickly
and the io are to become corrupted.

Use CAS to make sure only one thread dequeues and sets the io status.
The other concurrent threads will spin until there is a buffer. The fast
path will be that the buffer is already dequeued and then it is simply
reused.

Fixes #5324
2026-06-25 11:21:01 +02:00
..
control.c jack: make jackctl_server_close() succeed (still dummy) 2024-08-29 14:22:58 +02:00
dummy.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
export.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
meson.build pipewire-jack: emit foreign port registration callbacks on jack_activate 2026-03-13 09:21:20 +01:00
metadata.c jack: handle allocation errors better 2026-05-05 16:11:02 +02:00
net.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
pipewire-jack-extensions.h jack: Add UMP to MIDI conversions 2024-07-29 18:15:58 +02:00
pipewire-jack.c jack: fix race in get_buffer_output() 2026-06-25 11:21:01 +02:00
pw-jack.in pipewire-jack: Disable LD_LIBRARY_PATH when libjack is in libdir 2023-09-15 08:49:36 +00:00
ringbuffer.c add spa_memcpy to more places 2026-04-16 12:16:06 +02:00
statistics.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
uuid.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00