From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106700 invoked by alias); 29 Jun 2019 02:57:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 106682 invoked by uid 89); 29 Jun 2019 02:57:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:220.181.15, 126com, H*M:126, 126.com X-HELO: m15-111.126.com Received: from m15-111.126.com (HELO m15-111.126.com) (220.181.15.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Jun 2019 02:57:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Subject:From:Message-ID:Date:MIME-Version; bh=QQucl phRI+b1UOLviHoAoyfW1xxnHvIA5eAXl3HrZeE=; b=K4rBU6xfrik9u2+2Vd4yq xO140IjY3hBT/fnRXfGtU9uFpYTM+QSSSxc8cgXkV4dn7dDBUjwKE7i05ruMkWen qZgFt1SWV2wAbDDQexs8vaU/AFvZ0Pe39JJp1gOZMMIfKLN3Mt/qhoLuMDLTV83m 6n244moRMuxpL+BwGwhE78= Received: from [192.168.1.223] (unknown [116.236.172.42]) by smtp1 (Coremail) with SMTP id C8mowAD34lZc0xZdqCdEEA--.33268S2; Sat, 29 Jun 2019 10:56:32 +0800 (CST) Subject: Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows To: mingw-w64-public@lists.sourceforge.net, Jacek Caban , NightStrike Cc: libstdc++@gcc.gnu.org, Eric Botcazou , GCC Patches References: <2175092.5hV0XgF4mA@polaris> <30ed46f2-6672-f805-9627-05c31c8a708e@codeweavers.com> From: Liu Hao Openpgp: preference=signencrypt Message-ID: <715159ed-1f9b-768e-8ac1-130d0dcbbfd1@126.com> Date: Sat, 29 Jun 2019 02:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <30ed46f2-6672-f805-9627-05c31c8a708e@codeweavers.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Uq3O1M9rl3jFAb9dMXz6UREyXhtOlKYXM" X-SW-Source: 2019-06/txt/msg01877.txt.bz2 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Uq3O1M9rl3jFAb9dMXz6UREyXhtOlKYXM Content-Type: multipart/mixed; boundary="VHuu8TCVKNx7PXF2V4H9eN3HwlvWkkPGu"; protected-headers="v1" From: Liu Hao To: mingw-w64-public@lists.sourceforge.net, Jacek Caban , NightStrike Cc: libstdc++@gcc.gnu.org, Eric Botcazou , GCC Patches Message-ID: <715159ed-1f9b-768e-8ac1-130d0dcbbfd1@126.com> Subject: Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows References: <2175092.5hV0XgF4mA@polaris> <30ed46f2-6672-f805-9627-05c31c8a708e@codeweavers.com> In-Reply-To: <30ed46f2-6672-f805-9627-05c31c8a708e@codeweavers.com> --VHuu8TCVKNx7PXF2V4H9eN3HwlvWkkPGu Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Content-length: 962 =E5=9C=A8 2019/6/29 =E4=B8=8A=E5=8D=8812:10, Jacek Caban =E5=86=99=E9=81=93: >=20 > You don't really need to store the whole __gthr_win32_thr_desc in TLS. > If you stored just the handle, this wouldn't need a destructor. >=20 >=20 The handle to be stored in the TLS ('the Handle' for short hereinafter) should be a real handle, so there are a few scenarios that we should consider: 0) the Handle should be closed upon the spawned thread's exit; in this case a destructor is still necessary to prevent handle leaks. 1) the Handle is closed by the creator via either `*_join()` or `*_detach()`; in the latter case the Handle becomes invalid while the thread is running, so `*_self()` would return an invalid handle. It seems inappropriate to use handles as thread identifiers (as handles imply resource ownership and are not unique identifiers); thread IDs (as `DWORD` or `unsigned long`) would be a better alternative. --=20 Best regards, LH_Mouse --VHuu8TCVKNx7PXF2V4H9eN3HwlvWkkPGu-- --Uq3O1M9rl3jFAb9dMXz6UREyXhtOlKYXM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEn9eDGptREvfrWRePQbMyeCIxW8QFAl0W01wACgkQQbMyeCIx W8TR9Q//WdeUap7qSE9XgCH6/jfHw5SJ5xfcVOsgnekX5jvD35idKqlZzZCXlVM/ If1Kd++pUryAAvnDyA0sEQFWMq2DkWBYgt7PbNsqMgLwFTfysQZ779bAlYEovhGQ U5o6GBCAF1CZrsrsWkRUgm860uKu3gHCeUYxrePCYsrosgPvWRyWask5NsSClvVK 6i08b4BMvwMWwm9M7s0470kZ7ZqEDWcF8tn8VsC7VX33hCPYTtYR1Cu11F5kiZN1 KsJ4RHXcijXJIFBVbMNgoYWWTh3oyp2xFL0zYXvVEVoZhzhN2yzN1jdEuXbZyyAh EEnDes7gJqz4AQxBNpukKXwAq/VbIIZg3JX3dkSSR5Zy9LQZ5/CmCxdSfYutVw09 r27iuXGts4Yr4pqB0jitrw1e7L8R6tvOnNzLbJZPm0IaA3oMAno2Vo3jN1BsYuj7 pSsEZmG/I7obqVL3J7tlaYf5tKs0bgluoyNnWcHwSVu9FqUhhagAx1uq/3o9HJwE FJA3hABLsejhmXt72G/K6Xr7amwBILxMVAyPGTRQvdoTdtRs9573LZvSaWpCRjr5 3AxYd/DTnPks8ZbgyibMz2VuvfvufKMEu+lmyIv1P5NsrfVP1KBX/GhjgWKCRjw3 GJk01jp4YUnhbfSkprWuYNNu31VAeY6Q4+0cGhKKid5ymU2rD/4= =J9CJ -----END PGP SIGNATURE----- --Uq3O1M9rl3jFAb9dMXz6UREyXhtOlKYXM--