简体   繁体   中英

Ucontext gets blocked signal after swapcontext

I am blocking a SIGINT in ucontext A, for example, say I hit ^C (SIGINT) while it is running, nothing happens as expected.

In context B, there is a SIGINT handler. When I swapcontext(A, B) then ucontext B immediately executes the signal handler. Even though context A is the one that received and blocked this signal. Is there a way to ensure process B does not enter the signal handler right away?

While I did not figure this out, using a critical flag, instead of blocking the signal was what I used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM