diff --git a/clients/roscpp/include/ros/internal/condition_variable.h b/clients/roscpp/include/ros/internal/condition_variable.h index f8a4d5a58f..19b6a849c0 100644 --- a/clients/roscpp/include/ros/internal/condition_variable.h +++ b/clients/roscpp/include/ros/internal/condition_variable.h @@ -103,11 +103,13 @@ class condition_variable_monotonic { boost::unique_lock &lock, const boost::chrono::time_point &t) { - using namespace boost::chrono; - typedef time_point nano_sys_tmpt; + typedef boost::chrono::time_point + nano_sys_tmpt; wait_until(lock, - nano_sys_tmpt(ceil(t.time_since_epoch()))); - return steady_clock::now() < t ? boost::cv_status::no_timeout : boost::cv_status::timeout; + nano_sys_tmpt(ceil(t.time_since_epoch()))); + return boost::chrono::steady_clock::now() < t ? + boost::cv_status::no_timeout : + boost::cv_status::timeout; } template @@ -115,10 +117,9 @@ class condition_variable_monotonic { boost::unique_lock &lock, const boost::chrono::time_point &t) { - using namespace boost::chrono; - steady_clock::time_point s_now = steady_clock::now(); + boost::chrono::steady_clock::time_point s_now = boost::chrono::steady_clock::now(); typename Clock::time_point c_now = Clock::now(); - wait_until(lock, s_now + ceil(t - c_now)); + wait_until(lock, s_now + ceil(t - c_now)); return Clock::now() < t ? boost::cv_status::no_timeout : boost::cv_status::timeout; } @@ -127,18 +128,18 @@ class condition_variable_monotonic { boost::unique_lock &lock, const boost::chrono::duration &d) { - using namespace boost::chrono; - steady_clock::time_point c_now = steady_clock::now(); - wait_until(lock, c_now + ceil(d)); - return steady_clock::now() - c_now < d ? boost::cv_status::no_timeout : boost::cv_status::timeout; + boost::chrono::steady_clock::time_point c_now = boost::chrono::steady_clock::now(); + wait_until(lock, c_now + ceil(d)); + return boost::chrono::steady_clock::now() - c_now < d ? + boost::cv_status::no_timeout : + boost::cv_status::timeout; } boost::cv_status wait_until( boost::unique_lock &lk, boost::chrono::time_point tp) { - using namespace boost::chrono; - nanoseconds d = tp.time_since_epoch(); + boost::chrono::nanoseconds d = tp.time_since_epoch(); timespec ts = boost::detail::to_timespec(d); if (do_wait_until(lk, ts)) return boost::cv_status::no_timeout;