Hi Tanu, Also which thread does all of the hooks (PA_COE_HOOK_SINK_INPUT_PUT, and so on) run in? My understanding is that within the PA daemon process, PA daemon has a mainloop (which is a thread), and IO threads within the sinks or sources. Are there threads corresponding to each of the client applications (paplayer and so on)? Thank you every much. Tony ________________________________ From: Tong Wu <w_tong2000 at yahoo.com> To: Tanu Kaskinen <tanuk at iki.fi> Cc: "pulseaudio-discuss at lists.freedesktop.org" <pulseaudio-discuss at lists.freedesktop.org> Sent: Wednesday, February 20, 2013 4:46 PM Subject: Re: thread safe of idxset I see that for instance in function apply_cork_to_sink() in module-role-cork.c, there is a loop over all sink_inputs of a sink via idxset. What about a sink_input disappears during that loop? Is?apply_cork_to_sink()??running in the PA daemon's mainloop? And all sink_input's come and go only happen in the PA daemon's mainloop as well? Many thanks. Tony? ________________________________ From: Tanu Kaskinen <tanuk at iki.fi> To: Tong Wu <w_tong2000 at yahoo.com> Cc: "pulseaudio-discuss at lists.freedesktop.org" <pulseaudio-discuss at lists.freedesktop.org> Sent: Wednesday, February 20, 2013 2:58 PM Subject: Re: thread safe of idxset On Wed, 2013-02-20 at 14:52 -0800, Tong Wu wrote: > Is the loop over sink-input idxset of a sink thread safe? For > instance, when a sink-input disappears due to the end of playback, and > at the same time I am trying to loop over the related idxset hoding > the sink-input? pa_idxset is not thread safe. What code are you working on? -- Tanu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20130220/2195a6a6/attachment.html>