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

Reply via email to