X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:reply-to:to:subject :references:in-reply-to:content-type; q=dns; s=default; b=XA/RQS Yhy6ycUa9cSfD5VNeCk5ZWiE7Qyzr3hr6GYJpY+byhzXCDCFJ5UfMpwAsInlugmM guaxd+7aNHtFWYfcBACu4zufUU+aO4+kFip1Zln4o5uUBPGDfYflt+G4cQIjcVRg HXUW8DIsoeWwSr1TSNUD2WoetoIsXjw7nLWWM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:reply-to:to:subject :references:in-reply-to:content-type; s=default; bh=/gNlwrxlnGws ax1hu9+FfB2CN30=; b=sufFlSfIhpe8NSH4c5OBz+pTJkiWSCNFh7XXZK8Jj3gH xbR/0bzmqMrP96xli7o9It1Nc09hNtVX2Nq7GQ8lj+wAqCX89KWgPQ9tnajrNO4e 9TMpBrGYPSSKv0RzizxfbgFvrzJcLpWrrLLueNy9Hz3yskAuYv3f0LBAzXE34wk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Date: Sun, 14 Jul 2019 15:19:17 +0200 Message-ID: <2f15106bf3becd524ac77e7bf0209d31@smtp-cloud9.xs4all.net> From: Houder Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: sigpending() incorrectly returns signals pending on other threads References: <20190712153351 DOT GH3772 AT calimero DOT vinschen DOT de> In-Reply-to: <20190712153351.GH3772@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=fixed User-Agent: mua.awk 0.99 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