From patchwork Tue Mar 11 21:06:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 329228 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 562B62C00C6 for ; Wed, 12 Mar 2014 08:22:01 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=aTp4A9e4L+U2ZeeHgvpUugEdojLS7e vzEEtXrL1gyBUMrMJ8Ttc0VkgJrvSdKeovxfr1liUH5xdWH83AMXR2vzUtLM3wFr zXntRVGrPpUivGmWnxLLPRUeBrrGMe6ghmVsHrcJRLwjNbkUKmBg8tBHaZrmrOjg U/Ltj2iQaFXnI= 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=+WGn9pokt/O/gECuhw3bi/ZAEWQ=; b=CDbl KurHFQJg6P1fPUxGiy+St6MswcY9cRu/BHdtfqTj+6bnk3YBS7tH61wbpfwMjZ31 rVkyOU3k51kT8tSPZ6QiPZShG4q06TjjYGntewdP16Zhcnm3ebAV94qrqO/JdK83 lPrx62EVWRRU1GqZKMxvnI892bX27YzzzK4MP3g= Received: (qmail 4493 invoked by alias); 11 Mar 2014 21:21:53 -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 4475 invoked by uid 89); 11 Mar 2014 21:21:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Mar 2014 21:21:52 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2BLLCdR005787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Mar 2014 17:21:50 -0400 Received: from localhost (vpn1-5-90.ams2.redhat.com [10.36.5.90]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2BL6SCL011896; Tue, 11 Mar 2014 17:06:29 -0400 Date: Tue, 11 Mar 2014 21:06:27 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [patch] fix libstdc++/59680 Message-ID: <20140311210627.GA22200@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) On 9 January 2014 23:39, Jonathan Wakely wrote: > PR libstdc++/59680 > * src/c++11/thread.cc (__sleep_for): Fix call to ::sleep. > > Tested x86_64-linux, and tested again with a hacked c++config.h to use > ::sleep(), committed to trunk. Also backported to the 4.8 branch now. commit bdca0a1be8f2f59cba8ad3772c3b2f1d85aba0e8 Author: Jonathan Wakely Date: Tue Mar 11 19:45:53 2014 +0000 2014-03-11 Jonathan Wakely Backport from mainline. 2014-01-09 Jonathan Wakely PR libstdc++/59680 * src/c++11/thread.cc (__sleep_for): Fix call to ::sleep. diff --git a/libstdc++-v3/src/c++11/thread.cc b/libstdc++-v3/src/c++11/thread.cc index 8d040a7..0351f19 100644 --- a/libstdc++-v3/src/c++11/thread.cc +++ b/libstdc++-v3/src/c++11/thread.cc @@ -183,7 +183,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ::usleep(__us); } # else - ::sleep(__s.count() + (__ns >= 1000000)); + ::sleep(__s.count() + (__ns.count() >= 1000000)); # endif #elif defined(_GLIBCXX_HAVE_WIN32_SLEEP) unsigned long ms = __ns.count() / 1000000;