From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84799 invoked by alias); 14 Jul 2019 13:19:21 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 84792 invoked by uid 89); 14 Jul 2019 13:19:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=executive, accuracy, traditional, interest X-HELO: lb2-smtp-cloud9.xs4all.net Received: from lb2-smtp-cloud9.xs4all.net (HELO lb2-smtp-cloud9.xs4all.net) (194.109.24.26) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 14 Jul 2019 13:19:19 +0000 Received: from tmp.hFVkzmaBTm ([83.162.234.136]) by smtp-cloud9.xs4all.net with ESMTPSA id mePJhXWhPuEBxmePKhIfqQ; Sun, 14 Jul 2019 15:19:17 +0200 Date: Sun, 14 Jul 2019 13:19:00 -0000 Message-ID: <2f15106bf3becd524ac77e7bf0209d31@smtp-cloud9.xs4all.net> From: Houder Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com Subject: Re: sigpending() incorrectly returns signals pending on other threads References: <20190712153351.GH3772@calimero.vinschen.de> In-Reply-to: <20190712153351.GH3772@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=fixed User-Agent: mua.awk 0.99 X-SW-Source: 2019-07/txt/msg00108.txt.bz2 On Fri, 12 Jul 2019 17:33:51, Corinna Vinschen wrote: > On Jul 6 19:15, Kenton Varda wrote: > > I found a second problem which may or may not be related: > > If two threads use pthread_kill() to send each other the same signal, > > such that the signal should be separately pending on both threads at > > the same time, only one of the two signals is actually queued. It > > seems that pthread_kill() is ignored if the same signal is already > > pending on some other thread. > > The current signal mechanism in Cygwin only allows for a signal to be > queued once. Changing that is a pretty ambitioned task, which I simply > don't have enought time for. However, patches to change that are more > than welcome. .. uhm, just a note in the interest of accuracy ... - standard signals (which include USRSIG1 and USRSIG2) are not queued (traditional signal semantics) - only real-time signals should be queued ... The executive (cygwin1.dll) must maintain a record of the signals that are pending for the process as a whole, as well as a record of the signals that are pending for each thread. A call to sigpending() returns the union of the set of signals that are pending for the process and those that are pending for the calling thread. Source: 33.2.1 (How the Unix Signal Model maps to threads) of LPI. Undoubtedly, the signal mechanism in Cygwin must be "adapted", but as far as I can tell, there is no requirement to "queue" any of the standard signals ... Regards Henri -- 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