|
From: | Paolo Bonzini |
Subject: | Re: [PATCH] coroutine-sigaltstack: Keep SIGUSR2 handler up |
Date: | Sat, 23 Jan 2021 23:13:09 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 22/01/21 22:26, Laszlo Ersek wrote:
That seems bogus, per POSIX, given that all signals except SIGUSR2 are included in the mask passed to sigsuspend().
What happens if you get a SIGSTOP at exactly the wrong time? (Yeah I know how incredibly unlikely that would be).
BTW if we are in a mood for cleanup, there's no reason to use pthread_key_t instead of __thread + qemu_thread_atexit_add (adding a Notifier to struct CoroutineThreadState). That would fix the issue with async-signal safety of pthread_getspecific.
(It makes sense for the function not to be async-signal safe since it can in principle allocate memory for the data. In practice it's most likely okay if the function has been called before on this thread).
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |