This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/54847] --enable-libstdcxx-time=yes non-functional on darwin
- From: "howarth at nitro dot med.uc.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 07 Oct 2012 18:50:09 +0000
- Subject: [Bug libstdc++/54847] --enable-libstdcxx-time=yes non-functional on darwin
- Auto-submitted: auto-generated
- References: <bug-54847-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54847
--- Comment #5 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-10-07 18:50:09 UTC ---
As far as I can see the only usage of nanosleep() in libstdc++-v3 is in this
section of the include/std/thread header...
#ifdef _GLIBCXX_USE_NANOSLEEP
/// sleep_for
template<typename _Rep, typename _Period>
inline void
sleep_for(const chrono::duration<_Rep, _Period>& __rtime)
{
chrono::seconds __s =
chrono::duration_cast<chrono::seconds>(__rtime);
chrono::nanoseconds __ns =
chrono::duration_cast<chrono::nanoseconds>(__rtime - __s);
__gthread_time_t __ts =
{
static_cast<std::time_t>(__s.count()),
static_cast<long>(__ns.count())
};
::nanosleep(&__ts, 0);
}
/// sleep_until
template<typename _Clock, typename _Duration>
inline void
sleep_until(const chrono::time_point<_Clock, _Duration>& __atime)
{ sleep_for(__atime - _Clock::now()); }
#endif