Re: [Boost-bugs] [Boost C++ Libraries] #12949: using sleep_for in a thread context without including boost/thread/thread.hpp yields incorrect behaviour when BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC is defined

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12949: using sleep_for in a thread context without including boost/thread/thread.hpp yields incorrect behaviour when BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC is defined
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-04-29 02:08:46


#12949: using sleep_for in a thread context without including
boost/thread/thread.hpp yields incorrect behaviour when
BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC is defined
-------------------------------+----------------------
  Reporter: rkaris@… | Owner: anthonyw
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.63.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------

Comment (by viboes):

 This

 {{{
 #define BOOST_THREAD_VERSION 4
 #define BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC

 #include <boost/thread/condition_variable.hpp>

 #include "function.h"

 void f()
 {
     boost::this_thread::sleep_for(boost::chrono::milliseconds(10)); // **
 }
 }}}

 shouldn't compile. You need to include

 {{{
 <boost/thread/thread.hpp>
 }}}

 I will why it compiles.

 Are you testing on Windows?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12949#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-04-29 02:16:44 UTC