<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:14pt"><div><span>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?</span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>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?</span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times,
 serif; background-color: transparent; font-style: normal;"><span>Many thanks.</span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>Tony </span></div><div><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Tanu Kaskinen <tanuk@iki.fi><br> <b><span style="font-weight: bold;">To:</span></b> Tong Wu <w_tong2000@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b>
 "pulseaudio-discuss@lists.freedesktop.org" <pulseaudio-discuss@lists.freedesktop.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, February 20, 2013 2:58 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [pulseaudio-discuss] thread safe of idxset<br> </font> </div> <br>
On Wed, 2013-02-20 at 14:52 -0800, Tong Wu wrote:<br>> Is the loop over sink-input idxset of a sink thread safe? For<br>> instance, when a sink-input disappears due to the end of playback, and<br>> at the same time I am trying to loop over the related idxset hoding<br>> the sink-input?<br><br>pa_idxset is not thread safe. What code are you working on?<br><br>-- <br>Tanu<br><br><br><br> </div> </div>  </div></body></html>