This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/52680] New: std::this_thread::sleep_for #ifdef'd out by _GLIBCXX_USE_NANOSLEEP
- From: "mkline at cs dot wisc.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Mar 2012 01:35:06 +0000
- Subject: [Bug libstdc++/52680] New: std::this_thread::sleep_for #ifdef'd out by _GLIBCXX_USE_NANOSLEEP
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52680
Bug #: 52680
Summary: std::this_thread::sleep_for #ifdef'd out by
_GLIBCXX_USE_NANOSLEEP
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mkline@cs.wisc.edu
Created attachment 26963
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26963
A short test program (13 lines) illustrating the problem
Inside the thread header for C++11, _GLIBCXX_USE_NANOSLEEP is not defined on my
system, causing std::this_thread::sleep_for to be undefined. However, defining
it manually using -D_GLIBCXX_USE_NANOSLEEP causes the attached test program to
compile successfully and behave as intended.
I am using Ubuntu 10.04 LTS. The attached test code was successfully compiled
using
g++ -std=c++11 test.cpp -pthread -D_GLIBCXX_USE_NANOSLEEP