X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D2E93858415
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1706126948;
	bh=CcRGRdYBLugOvsYfNqd1Qk6XITv7wMo2XKeBElYIUsA=;
	h=Date:To:Cc:Subject:In-Reply-To:References:List-Id:
	 List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
	 From:Reply-To:From;
	b=LgglWYfB8I81yVCk7CYAk8ZY8MQDtCQBdILY7LKqWE+ffgMNwnZsswyN9DHtkWdYY
	 kFu1apneN3cMa+nrFxPAEfqnGoeUBtquDfUAqxecMTkXa2flKd+xYGczm9JPra0nNk
	 kafv7SH0Xu94pkm7dW8HMdRjdbzf7PuNEv2S/NjU=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A02243858D28
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A02243858D28
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706126927; cv=none;
 b=qudFhBixVJfyFvXXyeL+VKKLCDdLE3jgCcwzdh8voebN2Ulzav0ggdJW5CdBaqev+JN6xdShMFAoqCZKzapsNvo8dAyWhNcbndbbpsB9cJU8X61wYPYwsNqnSV+QQPTyP3PYVyqa5qvKgKlIbYYFMyx8GRxZgeci0FWV7vmUHQ4=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1706126927; c=relaxed/simple;
 bh=OTDeO3NEx68d/i2Jy+OWn8l2jEbHh1DnBRNaBHvn7tI=;
 h=DKIM-Signature:MIME-Version:Date:From:To:Subject:Message-ID;
 b=cKXMrVHD5NKjmX+KNSC7iRwsQz7l7aWkgqUr5BQTkXkbzC9fUoin1B3GTRS04Ty+6IR7hVHsxWcobatB9/DeNOKJMkNcuD04YuWm7+Ub8EKlkynaQc7XD6HKK//MqZCKXSuEyQ3H4xSiMhZc9skWLihgp2RnlRii0sYgWBlT3PI=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Authority-Analysis: v=2.4 cv=Lo2Bd1Rc c=1 sm=1 tr=0 ts=65b16e4d
 a=pMSlDXUwMa7SJ1EIez8PdQ==:117 a=pMSlDXUwMa7SJ1EIez8PdQ==:17
 a=kj9zAlcOel0A:10 a=dEuoMetlWLkA:10 a=uZvujYp8AAAA:8 a=lN_5w-FhJtvjiqjs_CYA:9
 a=CjuIK1q_8ugA:10 a=BvJ6B6o88AUA:10 a=SLzB8X_8jTLwj6mN0q5r:22
MIME-Version: 1.0
Date: Wed, 24 Jan 2024 12:08:42 -0800
To: Takashi Yano <takashi.yano@nifty.ne.jp>
Cc: cygwin@cygwin.com
Subject: Re: Possiblly bug of cygwin1.dll
In-Reply-To: <20240124205514.eaaa7162e3e858cbb39f5801@nifty.ne.jp>
References: <20240119224436.876a055f356f7c6796bc725b@nifty.ne.jp>
 <ZaqHGElhXZIc3NFX@calimero.vinschen.de>
 <20240120131825.4157c259fe058155137d6fe0@nifty.ne.jp>
 <c90e29238d7bb99ef6a8787f38585c21@kylheku.com>
 <20240124205514.eaaa7162e3e858cbb39f5801@nifty.ne.jp>
User-Agent: Roundcube Webmail/1.4.15
Message-ID: <69bed0a96ffea6cefae1b95d1c9f67a7@kylheku.com>
X-Sender: kaz@kylheku.com
X-CMAE-Envelope: MS4xfMX7QtNeoc1W15sbK6U2YZOA2/53f4kEIZuxzQE4FrCqAoRuuylaAZu2xtqXPvvY2h70/oJ/BXVALy+6nL0DjKGT0SIhPdjLrdTUQoVfD4QYW9xgc+tT
 oozJMVt20ocLf2tnv24YVWRqNZWy2F8Nz4SpWWy622aN1L5Pg2pff6vn3LjKh3YxZrHHQ1qcBCea0vdiA5jXc4LRNpdFqGHdcAc=
X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,
 SPF_HELO_NONE, SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Kaz Kylheku via Cygwin <cygwin@cygwin.com>
Reply-To: Kaz Kylheku <kaz@kylheku.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On 2024-01-24 03:55, Takashi Yano via Cygwin wrote:
> Are there any code examples that use PTHREAD_MUTEX_INITIALIZER
> with pthread_mutex_destroy()?

I don't think I've seen one.

I think they are rare in the field, precisely because
PTHREAD_MUTEX_INITIALIZER is mainly used in C code to
"initialize and forget" global mutexes, so they are ready
before the first thread is every created (and before main
is even called).

Nobody cares about destruction of global mutexes in an executable
(not shared library).

>> Use of the initializer is not restricted to static objects
>> by any normative wording.
> 
> It seems that I had read the older POSIX document.
> 
> https://pubs.opengroup.org/onlinepubs/007904875/functions/pthread_mutex_destroy.html

Aha! OK!

Because I had a memory of there had been something about a static restriction.

I took it for granted you were right about that, and was looking at that for other reasons.

So, good, that is gone. It never made sense anyway.

Pairing the initializer with the destructor call can be done in all situations now.

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