From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id A02243858D28 for ; Wed, 24 Jan 2024 20:08:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A02243858D28 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=kylheku.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=shaw.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A02243858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=3.97.99.33 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 Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id SdYYrzSzhGAIJSjYDrwnAi; Wed, 24 Jan 2024 20:08:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1706126925; bh=OTDeO3NEx68d/i2Jy+OWn8l2jEbHh1DnBRNaBHvn7tI=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=q+O9JoSS9cd0e0XheXgnOnYSNW2qQIt9IbdoraXcdtgsWX4oFfMG3E2h5DdkbMr1w hHIir4RDUQP1Ki81GRiGAFh+rxN52J1eNV+vsYhLoYWMxPBgMDx/C+SA4L2eQekz8V LCnBtFCKB9bTTzQc5lTPZzoOPdHTMeeUs7Io0eqRQUR/NUvgVsPli54MakysFJv/4P V8RcM85EYO7TII6IsurY3GfOQQZBx7p5Pgr5SG7fuMS/83kdzULVQuRWE6GUHunT5G H3AGZDlPzr+Ml6mC4HAE0DSvypDTOdMikz7dZogfUh/5IIpq4tPq60nbEUFtFU1C1q Mf9XXKxvTzKzg== Received: from kylheku.com ([70.79.182.7]) by cmsmtp with ESMTPSA id SjYBrVKwoZR3lSjYCrCfBl; Wed, 24 Jan 2024 20:08:45 +0000 Authentication-Results: ; auth=pass (PLAIN) smtp.auth=kkylheku@shaw.ca 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 Received: from localhost.localdomain ([127.0.0.1] helo=mail.kylheku.com) by kylheku.com with esmtp (Exim 4.94.2) (envelope-from ) id 1rSjYA-00CsLL-OW; Wed, 24 Jan 2024 12:08:42 -0800 MIME-Version: 1.0 Date: Wed, 24 Jan 2024 12:08:42 -0800 From: Kaz Kylheku To: Takashi Yano 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> <20240120131825.4157c259fe058155137d6fe0@nifty.ne.jp> <20240124205514.eaaa7162e3e858cbb39f5801@nifty.ne.jp> User-Agent: Roundcube Webmail/1.4.15 Message-ID: <69bed0a96ffea6cefae1b95d1c9f67a7@kylheku.com> X-Sender: kaz@kylheku.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 List-Id: 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.