From patchwork Tue Sep 1 11:09:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 512782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 8D7B4140216 for ; Tue, 1 Sep 2015 21:09:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=lN3BskCf; dkim-atps=neutral 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; q=dns; s=default; b=AM5vn32ZCUEo uveqVT8yVIc7OervW4L8KeiC0TEb1uhkefyTaSQQCY+IT8wgIZM1THIlv/v/JPKz bzWrCvyyWEF1chS2uBsSAc7UBlU1bqjuGNBEGDA/L57bnmIW7ylVMzjO6sXgLGNw s2Grd7vyCOLv0wRAYJKGqFe9o5KTQEY= 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; s=default; bh=2loWaIz08jVdS1FkOk 4fo648JBs=; b=lN3BskCfwW1tAZInQ50bTzSsX71JmqZFzNRho9DmpGQmVyVzLL AiGNDwF/s58ZlqBGVFXsS7DyuQ65A+5+blbZ0P1q6UzVZ2U1rS7mSwRuz4pfdmMl jmXfBOoYOdRcodWmPFKxXk6xRdB7o2qCPpsiSQeXdsZkUnuMPzWRBRxJI= Received: (qmail 73436 invoked by alias); 1 Sep 2015 11:09:35 -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 72827 invoked by uid 89); 1 Sep 2015 11:09:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RDNS_DYNAMIC autolearn=no version=3.3.2 X-HELO: mail.embedded-brains.de Received: from host-82-135-62-35.customer.m-online.net (HELO mail.embedded-brains.de) (82.135.62.35) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 01 Sep 2015 11:09:34 +0000 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 2B53B2A1930 for ; Tue, 1 Sep 2015 13:09:50 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id EO2RI6S0WSUv; Tue, 1 Sep 2015 13:09:49 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id B144D2A1820; Tue, 1 Sep 2015 13:09:49 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ncTp6cFQdf0u; Tue, 1 Sep 2015 13:09:49 +0200 (CEST) Received: from huber-linux.eb.localhost (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTP id 955D12A181D; Tue, 1 Sep 2015 13:09:49 +0200 (CEST) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Cc: Sebastian Huber Subject: [PATCH] libstdc++/67408 Date: Tue, 1 Sep 2015 13:09:29 +0200 Message-Id: <1441105769-9004-1-git-send-email-sebastian.huber@embedded-brains.de> X-IsSubscribed: yes 2015-09-01 Sebastian Huber PR libstdc++/67408 * include/std/mutex (__timed_mutex_impl): Use __timedlock(). (timed_mutex): Add friend class __timed_mutex_impl. Add __timedlock(). (recursive_timed_mutex): Likewise. --- libstdc++-v3/include/std/mutex | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index deb85df..2958e01 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -230,8 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_cast(__ns.count()) }; - auto __mutex = static_cast<_Derived*>(this)->native_handle(); - return !__gthread_mutex_timedlock(__mutex, &__ts); + return !static_cast<_Derived*>(this)->__timedlock(&__ts); } template @@ -293,6 +292,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION native_handle_type native_handle() { return &_M_mutex; } + + private: + friend class __timed_mutex_impl; + + int + __timedlock(const __gthread_time_t *__abs_timeout) + { return __gthread_mutex_timedlock(&_M_mutex, __abs_timeout); } }; /// recursive_timed_mutex @@ -346,6 +352,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION native_handle_type native_handle() { return &_M_mutex; } + + private: + friend class __timed_mutex_impl; + + int + __timedlock(const __gthread_time_t *__abs_timeout) + { return __gthread_recursive_mutex_timedlock(&_M_mutex, __abs_timeout); } }; #endif #endif // _GLIBCXX_HAS_GTHREADS