[pulseaudio-tickets] [PulseAudio] #799: libpulse use of Xlib is not thread-safe
PulseAudio
trac-noreply at tango.0pointer.de
Sat Mar 13 08:53:42 PST 2010
#799: libpulse use of Xlib is not thread-safe
-----------------------+----------------------------------------------------
Reporter: courmisch | Owner: lennart
Type: defect | Status: new
Milestone: | Component: module-x11-*
Keywords: |
-----------------------+----------------------------------------------------
As specified by the Xlib documentation, XInitThreads() '''must''' be
invoked before any other Xlib call in a multi-thread program.
Alternatively, all Xlib calls shall be protected by some synchronization
mechanism, such as a global Xlib use lock.
libpulse uses Xlib but does not call XInitThreads(). This compromises the
thread-safety of any process using libpulse in the likely case that Xlib
is also used from another thread. This is qutie common for multimedia
frameworks with the audio pipeline in one thread and the video pipeline in
another.
Unfortunately, I cannot find an easy fix for this issue. libpulse should
probably not call XInitThreads(). This would cause problems in a non-
threaded program that initializes Xlib before libpulse. Then libpulse
would call XInitThreads() while Xlib is already initialized in non-
threaded mode, which is invalid.
Since libpulse does a fairly minimal use of X11, using XCB instead of Xlib
might be a more reasonable option. That would get rid of the problem.
--
Ticket URL: <http://pulseaudio.org/ticket/799>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server
More information about the pulseaudio-bugs
mailing list