[libnice] Confusion about running threads of signal callbacks

Lorenzo Miniero lminiero at gmail.com
Thu May 13 09:34:21 UTC 2021

Il giorno gio 13 mag 2021 alle ore 11:21 Juan Navarro <juan.navarro at gmx.es>
ha scritto:

> Hi, my email was pretty technical and long so maybe a shorter summary
> question could be helpful:
> is libnice supposed to emit all its signals exclusively from the same
> thread than the one of its GMainContext?
Hi Juan,

of course I'm not the best to answer this, but just to share our
experience, we found out that not all signals are sent from the main
context thread, or at least not always. We discovered this when trying to
figure out a crash that someone reported for Janus about a year ago:


In our case, it was caused by the wrong assumption that the selected-pair
callback would always be fired by the same thread as the other libnice
events, which turned out not to be true:


As a consequence, we had to refactor the code a bit, so that some things we
were doing in place would be performed as a result on messaging on the same
loop libnice uses:


Not sure if this helps you with your issue, but I hope the perspective from
another developer helps clarifying your doubts a bit!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/nice/attachments/20210513/ee5cd1e3/attachment.htm>

More information about the nice mailing list