From patchwork Thu Oct 11 16:05:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 190933 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]) by ozlabs.org (Postfix) with SMTP id 6BBF62C00D0 for ; Fri, 12 Oct 2012 03:05:33 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350576334; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=URaJWeZCkw9VJzAKG2kO YIsYaAA=; b=TdKgiaS5YTcgJ5MqQl57ODx2u5wm5O5KDHUJrKbwhcGLLkeiu1Vw GTXuhKRXekfxhgxb3sKVAV/2ffFIRnWiHfEKbjKCBAWW4UxezGZe18FchrlnUckK 2EY5L9vznS4+RFDfrFCysBFui23+zgXjkztaK+1JpOwauzmcxZzS4I8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=touZgMCchsw6bakRw8lJdbTMeRWgFrA02XqSsPAMMd/MTGLIuFR1PCmjCtugVa BG7oUNN3Hv/q11yjmTZMMRVomaV7a+GzQfrX7+7Q3SgkIPJ5G3xVIhsGieSr74ii YgDikPnnZviRlghQd5yYuwRJ4FJ+FIx48cKu53rHXN9Bo=; Received: (qmail 27750 invoked by alias); 11 Oct 2012 16:05:25 -0000 Received: (qmail 27700 invoked by uid 22791); 11 Oct 2012 16:05:23 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Oct 2012 16:05:17 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id 27A9FB004B; Thu, 11 Oct 2012 12:05:16 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id q9BG5FQV023815; Thu, 11 Oct 2012 12:05:15 -0400 Date: Thu, 11 Oct 2012 12:05:15 -0400 From: Jack Howarth To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, mikestump@comcast.net, iain@codesourcery.com, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] revised fix for nanosleep check in GLIBCXX_ENABLE_LIBSTDCXX_TIME for darwin Message-ID: <20121011160515.GA23726@bromo.med.uc.edu> References: <20121009003921.GA25678@bromo.med.uc.edu> <20121009104928.661c8c18@coso> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) 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 On Thu, Oct 11, 2012 at 12:18:59AM +0100, Jonathan Wakely wrote: > On 11 October 2012 00:09, Jonathan Wakely wrote: > > On 9 October 2012 18:49, Benjamin De Kosnik wrote: > >> > >>> I don't like the sched_yield macro being set there because it's > >>> detected correctly by configure anyway, but I'm not going to labour > >>> that point any more. > >> > >> Indeed. Then somebody will waste hours in the future wondering why > >> configure says no but their TU says yes. > >> > >> At least a comment in the configure bits admitting defeat, people. > > > > Committed to trunk like so. > > Oops, that changelog entry missed out the PR number, so it hasn't > updated Bugzilla, sorry. > > Jack, please test and check and unpatched GCC trunk now supports > this_thread::yield() and this_thread::sleep_for(). Jonathan, The committed patch results in the expected this_thread::yield() and this_thread::sleep_for() support. I did run into a regression at -m32/-m64 on darwin10 (but not darwin11/12). WARNING: program timed out. FAIL: 30_threads/condition_variable/54185.cc execution test This actually isn't that surprising because the pthread support is buggy on darwin10. We always randomly fail the execution test for 20_util/shared_ptr/thread/default_weaktoshared.cc on darwin10. I filed that as radr://7905357, "testcase 20_util/shared_ptr/thread/default_weaktoshared.cc thread handling bug" back in 2010 and it was fixed in darwin11. Either we tolerate this regression on darwin10 or we can add something like... Hopefully Mike can chime in with an opinion here. I'll test this workaround later today on darwin10. Jack > > Thanks for persevering to get it working. Index: libstdc++-v3/config/os/bsd/darwin/os_defines.h =================================================================== --- libstdc++-v3/config/os/bsd/darwin/os_defines.h (revision 192370) +++ libstdc++-v3/config/os/bsd/darwin/os_defines.h (working copy) @@ -43,8 +43,10 @@ #define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC // Configure checks for nanosleep fail on Darwin, but nanosleep and -// sched_yield are always available, so use them. +// sched_yield are always available, so use them 10.6 or later. +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 #define _GLIBCXX_USE_NANOSLEEP 1 #define _GLIBCXX_USE_SCHED_YIELD 1 +#endif #endif