Proposal: provide runtime sigprocmask api to block some signal for go runtime

107 views
Skip to first unread message

hui zhang

unread,
Aug 13, 2019, 5:26:53 AM8/13/19
to golang-nuts
when we code golang with c,   some c code used   sigwait  sigwaitinfo function to wait signal.
sometime this signal is caught by golang runtime,  and this cause cash.
we want the signal continue to be handled by sigwait  sigwaitinfo


Jim Idle

unread,
Aug 14, 2019, 3:37:28 AM8/14/19
to hui zhang, golang-nuts
Note that you must not use sigprocmask in multi-threaded processes, because each thread has its own signal mask and there is no single process signal mask. According to POSIX, the behavior of sigprocmask in a multi-threaded process is “unspecified”. 

There is a lot more to signal handling than sigprocmask. If you read through all the docs, you should be able to work out what you want to do. 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/086f1e16-c8ea-4970-b4e8-98b34c4dec75%40googlegroups.com.

hui zhang

unread,
Aug 14, 2019, 4:50:24 AM8/14/19
to golang-nuts

thanks
I found a way throungh.
dynamic load so dlopen("go.so")  in main function after pthread_sigmask
this let go runtime start after father thread , and have the same sigmask.
Reply all
Reply to author
Forward
0 new messages