public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Houder <houder@xs4all.nl>
To: cygwin@cygwin.com
Subject: Re: REVISITED: Signal delivered while blocked
Date: Sun, 20 Aug 2017 12:59:00 -0000	[thread overview]
Message-ID: <46d2983f263cb1be122ad1c8f239c88c@smtp-cloud7.xs4all.net> (raw)
In-Reply-To: <c05c742f0f3809e6d1afb8fb2c646ad7@xs4all.nl>

On Wed, 16 Aug 2017 23:22:31, Houder wrote:
> 
> Hi,
> 
> Please read this post first:
> 
>      https://cygwin.com/ml/cygwin/2017-08/msg00048.html
>      ( Signal delivered while blocked -- by Noah Misch, August 4th 2017 )
> 
> This post is not intended to "hijack" the post by Noah Misch; this post 
> only ships an alternative (i.e. revised) testcase for the one by provided
> by Noah Misch.
> 
> The alternative testcase in fact consists of 2 testcases (2 files):
> 
>   1. sigprocmask-exclusion4.c
>   2. sigprocmask-exclusion5.c

Only for those interested ...

I made a minor modification to the 2nd testcase (sigprocmask-exclusion5.c) (in
order to get it theoretically correct).

I modified the last part (bottom) of each handler. See below.

On request, I will upload the files again.

Regards,

Henri

-----
handler(): // old

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	r = sigdelset(&set, SIGCHLD);
	if (r != 0) puts("retvalH1b");
	if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
		perror("sigprocmask");
				  // Cygwin: aborts, almost immediately
#endif
}

handler(): // new

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	{
		int rv = 0;
		if ( (rv = sigismember(&oset, SIGCHLD)) == -1)
			perror("sigismember");
		// if the other signal was enabled at the beginning, enable it again
		if (rv == 0) {
			if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
				perror("sigprocmask");
		}
	}
#endif
}

-----
handler2(): // old

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	r = sigdelset(&set, SIGUSR1);
	if (r != 0) puts("retvalH2b");
	if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
		perror("sigprocmask");
#endif
}

handler2(): // new

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	{
		int rv = 0;
		if ( (rv = sigismember(&oset, SIGUSR1)) == -1)
			perror("sigismember");
		// if the other signal was enabled at the beginning, enable it again
		if (rv == 0) {
			if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
				perror("sigprocmask");
		}
	}
#endif
}

=====


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2017-08-20 12:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16 21:22 Houder
2017-08-18 16:20 ` Corinna Vinschen
2017-08-20 13:20   ` Houder
2017-08-20 12:59 ` Houder [this message]
2017-08-20 15:44 ` Kaz Kylheku

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=46d2983f263cb1be122ad1c8f239c88c@smtp-cloud7.xs4all.net \
    --to=houder@xs4all.nl \
    --cc=cygwin@cygwin.com \
    /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: link
Be 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).