public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: wait_sig: allow to compute process-wide mask of pending signals Date: Tue, 1 Mar 2022 15:24:40 +0000 (GMT) [thread overview] Message-ID: <20220301152440.B36583858C83@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=195169186bfd58e45aaa31236575fb9d5957adad commit 195169186bfd58e45aaa31236575fb9d5957adad Author: Corinna Vinschen <corinna@vinschen.de> Date: Tue Mar 1 16:14:39 2022 +0100 Cygwin: wait_sig: allow to compute process-wide mask of pending signals Add a signal __SIGPENDINGALL to allow computing the mask of all currently pending signals. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Diff: --- winsup/cygwin/sigproc.cc | 20 ++++++++++++++++++++ winsup/cygwin/sigproc.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index edfdffd7c..449777cda 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -1371,6 +1371,26 @@ wait_sig (VOID *) case __SIGSTRACE: strace.activate (false); break; + case __SIGPENDINGALL: + { + unsigned bit; + bool issig_wait; + + *pack.mask = 0; + while ((q = q->next)) + { + if (q->sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo))) + { + tl_entry = cygheap->find_tls (q->si.si_signo, issig_wait); + if (tl_entry) + { + *pack.mask |= bit; + cygheap->unlock_tls (tl_entry); + } + } + } + } + break; case __SIGPENDING: { unsigned bit; diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index 2a3d248d1..23287c85b 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -22,7 +22,8 @@ enum __SIGHOLD = -(_NSIG + 7), __SIGNOHOLD = -(_NSIG + 8), __SIGSETPGRP = -(_NSIG + 9), - __SIGTHREADEXIT = -(_NSIG + 10) + __SIGTHREADEXIT = -(_NSIG + 10), + __SIGPENDINGALL = -(_NSIG + 11), }; #endif
reply other threads:[~2022-03-01 15:24 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220301152440.B36583858C83@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).