Is async-signal-safety applicable to Cygwin?

Eric Blake
Tue Mar 19 14:35:00 GMT 2019

On 3/19/19 9:28 AM, LRN wrote:
> ASS[0] is documented for Linux (and for POSIX) but i'm failing to find any
> information on how this applies to Cygwin. I assume, since there are no "real"
> signals on Cygwin, that it's not possible for a signal handler to break the
> state of some function that happened to be executed when the signal handler was
> triggered. But i could be wrong.

You are wrong. It IS applicable. Cygwin has signals and signal handlers;
although Windows may not have POSIX signals as such, it DOES have the
ability to interrupt a process mid-function when a timer expires, and
cygwin's implementation of signals on top of the semantics that windows
provides can indeed result in interrupting the middle of a
non-async-safe function.  Hence, a signal handler that calls a
non-async-safe function at the same time that the signal has interrupted
another non-async-safe function is indeed observable on Cygwin and can
indeed result in deadlocks (a classic example being the case if you
malloc() from a signal handler that interrupted an ongoing malloc() call).

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization: |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Cygwin mailing list