From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127241 invoked by alias); 26 Mar 2015 21:51:51 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 127206 invoked by uid 48); 26 Mar 2015 21:51:47 -0000 From: "jaak at ristioja dot ee" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/60421] std::this_thread::sleep_for doesn't sleep for all arguments Date: Thu, 26 Mar 2015 23:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jaak at ristioja dot ee X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg03068.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60421 Jaak Ristioja changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- --- Comment #6 from Jaak Ristioja --- I mean when I sleep for UINT64_MAX hours/years/millenia, you can't possibly wrap that into a single nanosleep call due to the limitations of the type time_t of the tv_sec parameter of the first argument to nanosleep. One obviously can not get around using loop. Additionally, the nanosleep code is also missing proper EINTR handling, which again could break the sleep. Reopening.