If it's ok with libuv maintainers, I'd like to send a PR with two
functions providing a simple way to control the sigmask for the
current thread, `uv_thread_block_signals` and
`uv_thread_unblock_signals`. These are useful for when you want to
handle signals in a loop running in a background thread.

I'm not sure of how these would be implemented on windows though.(not
even sure if windows has the concept of signals or sigmask)

On Sun, Mar 16, 2014 at 3:01 AM, Saúl Ibarra Corretgé <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Thiago,
>
> On 03/15/2014 02:58 AM, Thiago Arruda wrote:
>> I want to have an event loop(not the default one) handling signals
>> in a background thread.
>>
>> Does libuv provide an API to block signals from being delivered to
>> the main thread?
>>
>
> Not currently. You can use uv_signal handles on any loop, but there is
> no way to block signals on a given thread.
>
> - --
> Saúl Ibarra Corretgé
> bettercallsaghul.com
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: Using GnuPG with Icedove - http://www.enigmail.net/
>
> iQIcBAEBAgAGBQJTJT4jAAoJEEEOVVOum8BZu6oP/1uKN6Iy3rtUmVhWtlzEdQLM
> BnAY0UEPeuYcCsd5zPMAcuLF8M5iauRdUAoZB9tY8qM2eONbqmUIAl5TfaSphtK1
> X81UVuRHP3lZLYW2hJarpB1S5yLN8JdegDpT/TiQLBsp1mS9qH0erE2YmgTDdPE6
> DZyUwBTki8cy6X8z1nZ09V+jcn5OwN1+9Uw/EcDFyWuwjMjwvcT4IqIKMkkY2O24
> L/hvahBFyQmPDyhPDgRKZuzoXA91MnIY6xKe+aeZ7C6SVN1uFRmIYVna2u7Wv831
> GeqzISpLWdwTCnkXgpVeeSIPdNxYQlWy9NLQK42tpwxvc8foRIGAlEkz283VPMy5
> WcsrS/C5I7Aw1GotzwUL7Z8u06hUTzADJ69nv3OTuMYQLe1Qf01noM04qr6lTlsW
> vQYbUwK5ckZm1bVttriEl6up3iHlGywJqTedyPJYG6ztZ5o3390DhjbzouecUyIx
> dCED4zBmhwZW2pA3EQrENh+VoSda0lIyJo4mWFAYGkCfe3VrN4dINSkRs3DuC8EI
> bP34JboW0hHS+oa0OEN1xUFGP8eXz5FsRE9pbOeIYAB8/FJxrxcd2NowRCUEzq/n
> kVgu/afULTYjj7825mCbYuu10C+KeBMGVbtn+MyPaLfXkVVc4ozN5A/tsxJOFOs0
> UlZ1DcaKUTtwQ/M4wvP7
> =eQIo
> -----END PGP SIGNATURE-----
>
> --
> You received this message because you are subscribed to the Google Groups 
> "libuv" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/libuv.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to