Files
Waybar/src
Maja Kądziołka 6d28740896 Add locking for interacting with the pulseaudio thread
Before this commit, Waybar would sometimes get into a state
where it would consume 100% of a CPU core, and the pulseaudio widget
would stop responding to volume adjustments.

In this state, the pulseaudio mainloop thread would spin, with the
counter of enabled defer events at 1, but no actual enabled defer
event in the list to get the counter back to zero after an iteration
in the mainloop.

This could happen if the unsynchronized interactions with the mainloop
thread happened to modify the list of deferred events at the same
time as the mainloop.

This commit introduces locking in accordance with the PulseAudio
documentation on the threaded mainloop:

> The lock needs to be held whenever you call any PulseAudio function that
> uses an object associated with this main loop. Those objects include
> pa_mainloop, pa_context, pa_stream and pa_operation, and the various event
> objects (pa_io_event, pa_time_event, pa_defer_event).
2024-12-03 19:37:36 +01:00
..
2024-09-19 17:31:07 +02:00
2024-09-13 09:53:15 +02:00
2024-07-15 09:02:27 -05:00
2024-08-02 23:37:52 -05:00