On Sat, 18 Jan 2025, Takashi Yano wrote: > While debugging this problem, I encountered another hang issue, > which is fixed by: > 0001-Cygwin-signal-Avoid-frequent-tls-lock-unlock-for-SIG.patch
I'm concerned about this patch. There's a window where current_sig could be changed after exiting the while, before the lock is acquired by cygheap->find_tls (_main_tls); Should current_sig be rechecked after the lock is acquired to make sure that hasn't happened? Also, does current_sig need to be volatile, or is yield a sufficient fence for the compiler to know other threads may have changed the value?