From patchwork Tue Oct 15 17:57:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Crowe X-Patchwork-Id: 1177274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511050-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=mcrowe.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="E5OC+pwd"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mcrowe.com header.i=@mcrowe.com header.b="VeglJLH5"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46t3D31YxZz9sPJ for ; Wed, 16 Oct 2019 05:02:11 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=Rag cLxBA96EGzNBvA0wBVcshGsivYGQlerZeLC9NGMBVqACX+Ijm07i/MJM+E3xesmT ugSEnPWjUgNESlTlhy6iTzjsf+nLjmR2qEFLMzugBX9aeodxnKGxFx3sMH6h2we8 M+gYavxVWtL2Fr0evY8mD2tSqHBslluGbGvh0C0g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=isXh8lEsI HQIz8zMNlCH3/Pl8Js=; b=E5OC+pwdp1bmgCVSFLJ33Fir0rCUaYxpPqGby2Jka leUDbDkMjFwFbcldWkesRGC63LULLtG2tRSkAF7168YzRs22l4/ewXi2mVn/BTgh EwOYJkfqaXdEdI53lw8G+/XRpzHSbKoujCQUbZTk45jac6+0CEeEcg1xd9DHFu/9 NQ= Received: (qmail 62587 invoked by alias); 15 Oct 2019 17:58:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 61956 invoked by uid 89); 15 Oct 2019 17:58:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=unavailable version=3.3.1 spammy=HX-Languages-Length:1320, HContent-Transfer-Encoding:8bit X-HELO: avasout01.plus.net Received: from avasout01.plus.net (HELO avasout01.plus.net) (84.93.230.227) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Oct 2019 17:58:11 +0000 Received: from deneb ([80.229.24.9]) by smtp with ESMTP id KR5Fiu0njbMsOKR5HiVwbv; Tue, 15 Oct 2019 18:58:11 +0100 X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mcrowe.com; s=20191005; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=5bw53qDUTqzGrbd322FFWgVsJDMJ5iPr3lidxUT/9ug=; b=VeglJLH5eYi5eaaCZ6SuS+MIC6 VKIgbmvfymmFKUl5wGFVWsj62sIkgQLfxWbooa5i+Lp0aUt9StznIEJf9E8/HaAAbyKf06s5sVNNm EcHFZ3UtDn8O6tT8c8FUCL8koquIhFODzoay0XyyFHFnA30Mq8Y2U9AFtAQVBRonwNq0qrf6QEV8V YgCc74qoYbXOkvqxG8LbG0xRR3CKfWc03M4m3ycoag9C7/KDFaiW4ZsZTkyIYIm5VW9ngBCJMJVlz +dlIiNwrXMfqs7xCrPEOUY6mwmm4K0TsNnpEfHEr7s9nz3RWT5XGqYi6dY+mLSq1bxtTstum5wY1b DnfnWCDQ==; Received: from mac by deneb with local (Exim 4.92) (envelope-from ) id 1iKR4i-0003ph-Ne; Tue, 15 Oct 2019 18:57:36 +0100 From: Mike Crowe To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Mike Crowe Subject: [PATCH v2 04/11] libstdc++ testsuite: Also test unique_lock::try_lock_until with steady_clock Date: Tue, 15 Oct 2019 18:57:23 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 * testsuite/30_threads/unique_lock/locking/4.cc: Template test functions so they can be used to test both steady_clock and system_clock. --- libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc | 12 +++++-- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc index f10cd3f..1c544be 100644 --- a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc +++ b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc @@ -26,17 +26,18 @@ #include #include -int main() +template +void test() { typedef std::timed_mutex mutex_type; typedef std::unique_lock lock_type; - typedef std::chrono::system_clock clock_type; try { mutex_type m; lock_type l(m, std::defer_lock); - clock_type::time_point t = clock_type::now() + std::chrono::seconds(1); + const typename clock_type::time_point t = clock_type::now() + + std::chrono::seconds(1); try { @@ -61,6 +62,11 @@ int main() { VERIFY( false ); } +} +int main() +{ + test(); + test(); return 0; }