Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid namespace ambiguity #2

Open
wants to merge 1 commit into
base: fix-1343-melodic-devel-3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions clients/roscpp/include/ros/internal/condition_variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,22 @@ class condition_variable_monotonic {
boost::unique_lock<boost::mutex> &lock,
const boost::chrono::time_point<boost::chrono::steady_clock, Duration> &t)
{
using namespace boost::chrono;
typedef time_point<steady_clock, nanoseconds> nano_sys_tmpt;
namespace C = boost::chrono;
typedef C::time_point<C::steady_clock, C::nanoseconds> nano_sys_tmpt;
wait_until(lock,
nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
return steady_clock::now() < t ? boost::cv_status::no_timeout : boost::cv_status::timeout;
nano_sys_tmpt(ceil<C::nanoseconds>(t.time_since_epoch())));
return C::steady_clock::now() < t ? boost::cv_status::no_timeout : boost::cv_status::timeout;
}

template <class Clock, class Duration>
boost::cv_status wait_until(
boost::unique_lock<boost::mutex> &lock,
const boost::chrono::time_point<Clock, Duration> &t)
{
using namespace boost::chrono;
steady_clock::time_point s_now = steady_clock::now();
namespace C = boost::chrono;
C::steady_clock::time_point s_now = C::steady_clock::now();
typename Clock::time_point c_now = Clock::now();
wait_until(lock, s_now + ceil<nanoseconds>(t - c_now));
wait_until(lock, s_now + ceil<C::nanoseconds>(t - c_now));
return Clock::now() < t ? boost::cv_status::no_timeout : boost::cv_status::timeout;
}

Expand All @@ -127,18 +127,18 @@ class condition_variable_monotonic {
boost::unique_lock<boost::mutex> &lock,
const boost::chrono::duration<Rep, Period> &d)
{
using namespace boost::chrono;
steady_clock::time_point c_now = steady_clock::now();
wait_until(lock, c_now + ceil<nanoseconds>(d));
return steady_clock::now() - c_now < d ? boost::cv_status::no_timeout : boost::cv_status::timeout;
namespace C = boost::chrono;
C::steady_clock::time_point c_now = C::steady_clock::now();
wait_until(lock, c_now + ceil<C::nanoseconds>(d));
return C::steady_clock::now() - c_now < d ? boost::cv_status::no_timeout : boost::cv_status::timeout;
}

boost::cv_status wait_until(
boost::unique_lock<boost::mutex> &lk,
boost::chrono::time_point<boost::chrono::steady_clock, boost::chrono::nanoseconds> tp)
{
using namespace boost::chrono;
nanoseconds d = tp.time_since_epoch();
namespace C = boost::chrono;
C::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;
Expand Down