From owner-freebsd-questions@freebsd.org Fri Aug 9 09:33:42 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56FFCC39F4; Fri, 9 Aug 2019 09:33:42 +0000 (UTC) (envelope-from freebsd.ed.lists@sumeritec.com) Received: from out2-5.antispamcloud.com (out2-5.antispamcloud.com [185.201.17.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 464g6C0GZZz4JRm; Fri, 9 Aug 2019 09:33:38 +0000 (UTC) (envelope-from freebsd.ed.lists@sumeritec.com) Received: from srv31.niagahoster.com ([153.92.8.106]) by mx37.antispamcloud.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1hw1HA-0005Nb-Ul; Fri, 09 Aug 2019 11:33:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sumeritec.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hX9wl38457SNmf86WztVwtpoEIFIv6tGprCX7D7NvH8=; b=c/rn/U9V4lD7eR6gFKbtCP62Kx XfEMqAoFOYF1kTHDgiJPhp3DVqMxP/zztQKU1Sldm8XFSlsEO42TNJODCVLCXXL32dI/XnnyEBYud l4DRiOcULciaJWNzTTHcGAjHEN4c4PZYNcZnv4mhqQ722gGnlU0iDZKXgb4xQUCfOnJmBQZrioJ3g crO5t8xlzPYWN+eSPZ1aJvOjugWjIye3f+l2kl/dY3qpIlLa2bJWaOUjPKeeDCDlb4Z3WzAOYmysa zPiFnj24bT2+Mc8UT7YqzpdTf/NQc4uXwfJzduEVIH0B/VfAzNCUoMr+OtUP/d3zdYdLjW36uG1NR i56cgz9g==; Received: from [114.125.118.127] (port=23274 helo=Ryzen1.sumeritec.com) by srv31.niagahoster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hw1GI-0004ds-GR; Fri, 09 Aug 2019 16:32:44 +0700 Date: Fri, 9 Aug 2019 17:32:35 +0800 From: Erich Dollansky To: Daniel Eischen Cc: freebsd-questions@freebsd.org, freebsd-threads@freebsd.org Subject: Re: mutex held in a thread which is cancelled stays busy Message-ID: <20190809173235.2b6aa029.freebsd.ed.lists@sumeritec.com> In-Reply-To: References: <20190806165429.14bc4052.freebsd.ed.lists@sumeritec.com> <1FC05CEB-982F-484F-9E41-5A74FF564494@freebsd.org> <20190807071002.GF2731@kib.kiev.ua> <20190807163757.2b5d52fa.freebsd.ed.lists@sumeritec.com> <20190807092035.GG2731@kib.kiev.ua> <20190807182548.1a8e00dd.freebsd.ed.lists@sumeritec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-1.0 X-AuthUser: freebsd.ed.lists@sumeritec.com X-Originating-IP: 153.92.8.106 X-Spampanel-Domain: out.niagahoster.com X-Spampanel-Username: niaga X-Spampanel-Outgoing-Class: unsure X-Spampanel-Outgoing-Evidence: Combined (0.15) X-Recommended-Action: accept X-Filter-ID: Mvzo4OR0dZXEDF/gcnlw0YiRRkpbHZ8F3zevhEShTfypSDasLI4SayDByyq9LIhVUZbR67CQ7/vm /hHDJU4RXkTNWdUk1Ol2OGx3IfrIJKyP9eGNFz9TW9u+Jt8z2T3KSZWQ0mYy/5bX2tR2MxjY1He4 QIvBAg3toE6wd3PtFST6QG6oDWQr5qk8z/hipQQViX96l/tFvjme58IPsHkDAFiitpb3kg2n6/4g cUiqnb8W1xUKhGnKGbei0u7q3nc7e9tWEp4LOzvZZshxor9/dSTg127TqHZDxA/kZB41Rh+qlyJD Hkk4rmks4GDcGufSRgudzGUUerEAVH/t0RiO6pD6AS7wG2J0akSI9h0P1G6DwIE7VKe+bqpcdCns 72R1040BPtH5AjgBUwdnLhigo3PhS4R573H1viWXdj+WVBMD0NtCO8JxriscWzJ0F8DaL7mGYMmK DF5D7THA4SR2KBqj44ngr3oIWTLM+47Ewp4f27xvBBHtPpxgCVRDLa+kipBvNb5FuO0jb82+DP1/ p6PCcmi8K0ucY0Dl27Fx+mk8/adlWwzBehNktFp1Au30caV9d2aAmsqMGVOlazvzL1nhNXrZS1QT TBGlJEzGzGqRVYKU9W9tbmVXJBqdHHDmDZAR62S8fTT/GafqgXnPyyS4Hh8s12ybj3OcYQ7BbVHJ pP5+GeY+Zn45S5XkEzp7LLlWjrE6IX2XGQJt2ZBm5Fmy55tOY6IlA5v+KBmneSBlqbz7odydEhWm hX+vFWOhB7r9MEh6d5BDOmwQbH0yoWb/iFkVRsexkWLDVEhgSVkKtXsJv6yBDhKCKVr3GsqCiwQz Kw+6v3CaIMG6s7LqJBUdVk0WEIFuQsWzpA4m675OCKtJalRp40OMIBJRTodrHYxR6c/Q3Xlz0XoD m9ZKxGu9ZRSpnbN5UmZ7H68qAIVvA3QEKTMFvUWB5kl7tpOKxjiK+UpyMoLOvGB1ZueRx8OpyKA6 9LF1Ge2GaGfxmfoDzBgloy+Ctoaiw1p/73ruZHq1JMC83k5wSeWJfaTC39aepAO/K630eHPSiGhL G21rwytzyq4nhu0+m3/YUu4UQUF+p3oNM25euFxgcyJ9Hnm/BwAe1nh2Rt74x1AyEZtsbeEDapU2 quQoCNMpMCDh9jihx+Za/cV70jOJzN2r4A== X-Report-Abuse-To: spam@quarantine10.antispamcloud.com X-Rspamd-Queue-Id: 464g6C0GZZz4JRm X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sumeritec.com header.s=default header.b=c/rn/U9V; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd.ed.lists@sumeritec.com has no SPF policy when checking 185.201.17.5) smtp.mailfrom=freebsd.ed.lists@sumeritec.com X-Spamd-Result: default: False [-2.63 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[sumeritec.com:s=default]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sumeritec.com]; NEURAL_HAM_LONG(-0.99)[-0.990,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.29)[ipnet: 185.201.17.0/24(-1.21), asn: 49544(-0.24), country: NL(0.01)]; DKIM_TRACE(0.00)[sumeritec.com:+]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[5.17.201.185.list.dnswl.org : 127.0.3.1]; RECEIVED_SPAMHAUS_PBL(0.00)[127.118.125.114.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:49544, ipnet:185.201.17.0/24, country:NL]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2019 09:33:42 -0000 Hi, On Wed, 7 Aug 2019 13:26:31 -0400 Daniel Eischen wrote: > > On Aug 7, 2019, at 6:25 AM, Erich Dollansky > > wrote: > > > >> Erich, are you getting EBUSY for pthread_mutex_lock() or is that > >> only for pthread_mutex_trylock()? > >> > > EBUSY is only returned when I call 'pthread_mutex_trylock'. The > > other one just hangs. > > In this case, I think FreeBSD is behaving correctly. I think perhaps > the only problem is that the man page isn't reflecting the POSIX > wording. I only could go back to my test program now. I made the wrong assumption that 'EOWNERDEAD' will be repeated. This error message comes only one time. The caller has then to call 'pthread_mutex_consistent' to correct the error. Having a program which misses one return value leads to the problem I have had. At least we learned with this that FreeBSD's version of pthreads is a much more practical attempt than some others. Erich