pipewire/spa/plugins/support
Barnabás Pőcze 5fed160972 spa: support: loop: do not call control hooks on blocking invoke
The control hooks of a loop are called before the loop starts polling
and after it has finished polling. Currently, this is used to implement
the locking in pw_thread_loop. This is used to guarantee that the thread
loop's lock is taken while the thread loop is dispatching, and that
the lock can be taken while the loop is polling, when it is running
no user-space code.

However, calling the thread control hooks of thread A when doing an
blocking invoke from thread B serves little purpose, and in fact
can cause issues: for example, issuing a blocking invoke on a
pw_thread_loop does not work unless the lock thereof is taken.

This behaviour, of calling the control hooks from other threads,
is also not documented, and goes contrary to what is currently
stated in the loop.h header file:

  /** Executed right before waiting for events. It is typically used to
   * release locks. */
  ...
  /** Executed right after waiting for events. It is typically used to
   * reacquire locks. */

At the moment the implementation allows any thread to queue invoke
items on any other thread without restrictions; calling the control
hooks only places extra restrictions on the usability of this mechanism
(in case of pw_thread_loop, having to take the loop's lock).
So do not call the control hooks when doing a blocking invoke.
2024-08-06 17:50:38 +02:00
..
cpu-arm.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
cpu-x86.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
cpu.c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
dbus.c spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
evl-plugin.c spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
evl-system.c spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
journal.c journal: prepend code location to messages at debug log levels 2024-04-28 16:02:28 +03:00
logger.c treewide: fix some format string issues 2024-04-25 07:24:10 +00:00
loop.c spa: support: loop: do not call control hooks on blocking invoke 2024-08-06 17:50:38 +02:00
meson.build spa: support: remove log pattern support 2024-01-04 10:02:55 +00:00
node-driver.c node-driver: 5 seconds of freewheel timeout is enough 2024-07-12 12:30:42 +02:00
null-audio-sink.c spa: improve null-audio-sink channels 2024-03-28 17:11:16 +01:00
plugin.c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
system.c pipewire-alsa: Propagate errors from eventfd(). 2024-02-19 14:16:26 +00:00