From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 812373834F01 for ; Wed, 22 Jun 2022 09:13:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 812373834F01 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-6-EgOh_NH8PEGwTnoOpjjSPA-1; Wed, 22 Jun 2022 05:13:45 -0400 X-MC-Unique: EgOh_NH8PEGwTnoOpjjSPA-1 Received: by mail-ej1-f70.google.com with SMTP id ne36-20020a1709077ba400b00722d5f547d8so2894340ejc.19 for ; Wed, 22 Jun 2022 02:13:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U+2OAxYdMDgxVsakxvtEx+r9vh5h4hi/tf26u1TrAuU=; b=iTxjIt1GY041L75BofNCSG+mblbQG3U9NRYDBoxqh1BC/N/tksFH6GXOS4mx1K1dW0 Xb5aYovkMsUacovTyGCXSd4mFFyvqWweTXv3TLFrgZ9QRC65eU8KHTXTmQRF5bUIYz4k Qr4spCCj/ke4mtNIDPconx060CJDcEmkRz/IDiChW63qK0vkNv/G00OQ/WNc/iR0j+aY UTLTqmtUXUrybv4x3r1PosVb29jyOuX0fr0f5j5v+Dxbj8FTjHPLYQE2RcxV2UXQeQ3r Aj9X24rqe4kQX8pvoWp5M+kWXJts2QTkonfEWydoHf1Ts6TnNfBxwQiwlzR9JJeqUglk thZg== X-Gm-Message-State: AJIora8c8TX0ogZI8w4C19vGXPjFtOKzNeMAIRXkYF0PMZMUkhhwwdcn kv9829BuW25bIQfvKKsJ69FNBQIRJSgkHbE8emqg2vIHnRHdYbu+7+IfN2mmX85UWHiN7qSjORZ EEMi6cDKW3WxHZ1NAl+qi0esdIBqScrk= X-Received: by 2002:a17:907:6294:b0:6e1:ea4:74a3 with SMTP id nd20-20020a170907629400b006e10ea474a3mr2152159ejc.168.1655889224772; Wed, 22 Jun 2022 02:13:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkEEYL9xNlEIUIaoDZJVnpCO9WHAgnupwAcRzv+JEJQVDVpk7OTuzyL9dJB1EV0vIAHqPts7WEPonhW0OGcMQ= X-Received: by 2002:a17:907:6294:b0:6e1:ea4:74a3 with SMTP id nd20-20020a170907629400b006e10ea474a3mr2152146ejc.168.1655889224615; Wed, 22 Jun 2022 02:13:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 22 Jun 2022 10:13:33 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: testsuite: tolerate non-cancelling sleep To: Alexandre Oliva Cc: gcc Patches , "libstdc++" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2022 09:13:49 -0000 On Wed, 22 Jun 2022 at 06:26, Alexandre Oliva via Libstdc++ wrote: > > > Though sleep, nanosleep and clock_nanosleep are all POSIX cancellation > points, not all target systems follow this POSIX requirement. > 30_threads/thread/native_handle/cancel.cc will run until it times out > on such systems. > > Rather than failing a C++ library test because of a limitation of the > target system, this patch gives the test a chance to successfully > exercise the features it intends to exercise, by introducing a > cancellation point in a loop that would otherwise run indefinitely on > systems exhibiting this limitation. > > Regstrapped on x86_64-linux-gnu, also tested with a cross to > aarch64-rtems6. Ok to install? OK, thanks. This test is already explicitly pthread-specific, so there's no problem using pthread_testcancel there. It already uses pthread_cancel, and is gated by: // { dg-require-effective-target pthread }