Lennart Poettering wrote: > On Tue, 23.03.10 00:36, David Henningsson (launchpad.web at epost.diwic.se) wrote: > >>> What is missing is that the jack loop does not depend on the PA sink to >>> be around resp. the PA IO loop doesn't call into jack when it is >>> dead. If either of that is implemented (and then destruction order >>> matches this) the problem is fixed. >>> >>> Also, what applies to m-jack-sink needs fixing in m-jack-source, too. >> Good points. I admit to not having checked properly whether >> pa_sink_unlink and pa_sink_render_full can be called in parallell, I see >> now that they shouldn't. > > Calling _unlink() and _render_full() at the same time is actually > fine. _unlink() will send a msg to the IO thread to shut down the sink > and will synchronously wait for it. _render_full() is called from the IO > thread. Since the msg dispatching and the _render_full() are run from > the same thread and hence are serialized there is no problem here. Oh, so pa_sink_unlink does synchronize with the IO thread. But then I don't see the "new" race? What call into pa would be a problem after the sink has been unlinked? It can't be sink rendering, as u->sink->thread_info.state != PA_SINK_RUNNING at that point, so the module will just write silence (and not call into pa). // David