[cfe-commits] [libcxx] r119909 - in /libcxx/trunk: include/ src/ test/thread/thread.condition/thread.condition.condvar/ test/thread/thread.condition/thread.condition.condvarany/ test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/ test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/ test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/ test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/ test/utilities...
Howard Hinnant
hhinnant at apple.com
Sat Nov 20 11:16:31 PST 2010
Author: hhinnant
Date: Sat Nov 20 13:16:30 2010
New Revision: 119909
URL: http://llvm.org/viewvc/llvm-project?rev=119909&view=rev
Log:
N3191: C++ Timeout Specification
Modified:
libcxx/trunk/include/__mutex_base
libcxx/trunk/include/chrono
libcxx/trunk/include/condition_variable
libcxx/trunk/include/future
libcxx/trunk/include/mutex
libcxx/trunk/include/thread
libcxx/trunk/src/chrono.cpp
libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until.pass.cpp
libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until_pred.pass.cpp
libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until.pass.cpp
libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until_pred.pass.cpp
libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp
libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp
libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_for.pass.cpp
libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_until.pass.cpp
libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp
libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp
libcxx/trunk/test/utilities/time/clock.h
libcxx/trunk/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp
libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp
libcxx/trunk/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
Modified: libcxx/trunk/include/__mutex_base
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__mutex_base?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/include/__mutex_base (original)
+++ libcxx/trunk/include/__mutex_base Sat Nov 20 13:16:30 2010
@@ -382,11 +382,11 @@
const chrono::duration<_Rep, _Period>& __d)
{
using namespace chrono;
- system_clock::time_point __s_now = system_clock::now();
- monotonic_clock::time_point __c_now = monotonic_clock::now();
+ system_clock::time_point __s_now = system_clock::now();
+ steady_clock::time_point __c_now = steady_clock::now();
__do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__d));
- return monotonic_clock::now() - __c_now < __d ? cv_status::no_timeout :
- cv_status::timeout;
+ return steady_clock::now() - __c_now < __d ? cv_status::no_timeout :
+ cv_status::timeout;
}
template <class _Rep, class _Period, class _Predicate>
@@ -396,7 +396,7 @@
const chrono::duration<_Rep, _Period>& __d,
_Predicate __pred)
{
- return wait_until(__lk, chrono::monotonic_clock::now() + __d,
+ return wait_until(__lk, chrono::steady_clock::now() + __d,
_STD::move(__pred));
}
Modified: libcxx/trunk/include/chrono
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/chrono?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/include/chrono (original)
+++ libcxx/trunk/include/chrono Sat Nov 20 13:16:30 2010
@@ -223,26 +223,26 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<system_clock> time_point;
- static const bool is_monotonic = false;
+ static const bool is_steady = false;
static time_point now();
static time_t to_time_t (const time_point& __t);
static time_point from_time_t(time_t __t);
};
-class monotonic_clock
+class steady_clock
{
public:
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<monotonic_clock, duration> time_point;
- static const bool is_monotonic = true;
+ typedef chrono::time_point<steady_clock, duration> time_point;
+ static const bool is_steady = true;
static time_point now();
};
-typedef monotonic_clock high_resolution_clock;
+typedef steady_clock high_resolution_clock;
} // chrono
@@ -843,26 +843,26 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<system_clock> time_point;
- static const bool is_monotonic = false;
+ static const bool is_steady = false;
static time_point now();
static time_t to_time_t (const time_point& __t);
static time_point from_time_t(time_t __t);
};
-class _LIBCPP_VISIBLE monotonic_clock
+class _LIBCPP_VISIBLE steady_clock
{
public:
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<monotonic_clock, duration> time_point;
- static const bool is_monotonic = true;
+ typedef chrono::time_point<steady_clock, duration> time_point;
+ static const bool is_steady = true;
static time_point now();
};
-typedef monotonic_clock high_resolution_clock;
+typedef steady_clock high_resolution_clock;
} // chrono
Modified: libcxx/trunk/include/condition_variable
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/condition_variable?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/include/condition_variable (original)
+++ libcxx/trunk/include/condition_variable Sat Nov 20 13:16:30 2010
@@ -232,7 +232,7 @@
condition_variable_any::wait_for(_Lock& __lock,
const chrono::duration<_Rep, _Period>& __d)
{
- return wait_until(__lock, chrono::monotonic_clock::now() + __d);
+ return wait_until(__lock, chrono::steady_clock::now() + __d);
}
template <class _Lock, class _Rep, class _Period, class _Predicate>
@@ -242,7 +242,7 @@
const chrono::duration<_Rep, _Period>& __d,
_Predicate __pred)
{
- return wait_until(__lock, chrono::monotonic_clock::now() + __d,
+ return wait_until(__lock, chrono::steady_clock::now() + __d,
_STD::move(__pred));
}
Modified: libcxx/trunk/include/future
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/future?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/include/future (original)
+++ libcxx/trunk/include/future Sat Nov 20 13:16:30 2010
@@ -603,7 +603,7 @@
future_status
__assoc_sub_state::wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
{
- return wait_until(chrono::monotonic_clock::now() + __rel_time);
+ return wait_until(chrono::steady_clock::now() + __rel_time);
}
template <class _R>
Modified: libcxx/trunk/include/mutex
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/mutex?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/include/mutex (original)
+++ libcxx/trunk/include/mutex Sat Nov 20 13:16:30 2010
@@ -221,7 +221,7 @@
template <class _Rep, class _Period>
_LIBCPP_INLINE_VISIBILITY
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
- {return try_lock_until(chrono::monotonic_clock::now() + __d);}
+ {return try_lock_until(chrono::steady_clock::now() + __d);}
template <class _Clock, class _Duration>
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
void unlock();
@@ -264,7 +264,7 @@
template <class _Rep, class _Period>
_LIBCPP_INLINE_VISIBILITY
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
- {return try_lock_until(chrono::monotonic_clock::now() + __d);}
+ {return try_lock_until(chrono::steady_clock::now() + __d);}
template <class _Clock, class _Duration>
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
void unlock();
Modified: libcxx/trunk/include/thread
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/thread?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/include/thread (original)
+++ libcxx/trunk/include/thread Sat Nov 20 13:16:30 2010
@@ -406,10 +406,10 @@
template <class _Duration>
inline _LIBCPP_INLINE_VISIBILITY
void
-sleep_until(const chrono::time_point<chrono::monotonic_clock, _Duration>& __t)
+sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
{
using namespace chrono;
- sleep_for(__t - monotonic_clock::now());
+ sleep_for(__t - steady_clock::now());
}
inline _LIBCPP_INLINE_VISIBILITY
Modified: libcxx/trunk/src/chrono.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/chrono.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/src/chrono.cpp (original)
+++ libcxx/trunk/src/chrono.cpp Sat Nov 20 13:16:30 2010
@@ -44,7 +44,7 @@
return system_clock::time_point(seconds(t));
}
-// monotonic_clock
+// steady_clock
#if __APPLE__
// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
@@ -58,15 +58,15 @@
#pragma GCC visibility push(hidden)
static
-monotonic_clock::rep
-monotonic_simplified()
+steady_clock::rep
+steady_simplified()
{
return mach_absolute_time();
}
static
double
-compute_monotonic_factor()
+compute_steady_factor()
{
mach_timebase_info_data_t MachInfo;
mach_timebase_info(&MachInfo);
@@ -74,32 +74,32 @@
}
static
-monotonic_clock::rep
-monotonic_full()
+steady_clock::rep
+steady_full()
{
- static const double factor = compute_monotonic_factor();
- return static_cast<monotonic_clock::rep>(mach_absolute_time() * factor);
+ static const double factor = compute_steady_factor();
+ return static_cast<steady_clock::rep>(mach_absolute_time() * factor);
}
-typedef monotonic_clock::rep (*FP)();
+typedef steady_clock::rep (*FP)();
static
FP
-init_monotonic_clock()
+init_steady_clock()
{
mach_timebase_info_data_t MachInfo;
mach_timebase_info(&MachInfo);
if (MachInfo.numer == MachInfo.denom)
- return &monotonic_simplified;
- return &monotonic_full;
+ return &steady_simplified;
+ return &steady_full;
}
#pragma GCC visibility pop
-monotonic_clock::time_point
-monotonic_clock::now()
+steady_clock::time_point
+steady_clock::now()
{
- static FP fp = init_monotonic_clock();
+ static FP fp = init_steady_clock();
return time_point(duration(fp()));
}
@@ -109,12 +109,12 @@
// _POSIX_MONOTONIC_CLOCK and fall back to something else if those
// don't exist.
-// Warning: If this is not truly monotonic, then it is non-conforming. It is
+// Warning: If this is not truly steady, then it is non-conforming. It is
// better for it to not exist and have the rest of libc++ use system_clock
// instead.
-monotonic_clock::time_point
-monotonic_clock::now()
+steady_clock::time_point
+steady_clock::now()
{
struct timespec tp;
if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
Modified: libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until.pass.cpp Sat Nov 20 13:16:30 2010
@@ -28,13 +28,13 @@
typedef duration::rep rep;
typedef duration::period period;
typedef std::chrono::time_point<Clock> time_point;
- static const bool is_monotonic = true;
+ static const bool is_steady = true;
static time_point now()
{
using namespace std::chrono;
return time_point(duration_cast<duration>(
- monotonic_clock::now().time_since_epoch()
+ steady_clock::now().time_since_epoch()
));
}
};
Modified: libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until_pred.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until_pred.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until_pred.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.condition/thread.condition.condvar/wait_until_pred.pass.cpp Sat Nov 20 13:16:30 2010
@@ -29,13 +29,13 @@
typedef duration::rep rep;
typedef duration::period period;
typedef std::chrono::time_point<Clock> time_point;
- static const bool is_monotonic = true;
+ static const bool is_steady = true;
static time_point now()
{
using namespace std::chrono;
return time_point(duration_cast<duration>(
- monotonic_clock::now().time_since_epoch()
+ steady_clock::now().time_since_epoch()
));
}
};
Modified: libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until.pass.cpp Sat Nov 20 13:16:30 2010
@@ -27,13 +27,13 @@
typedef duration::rep rep;
typedef duration::period period;
typedef std::chrono::time_point<Clock> time_point;
- static const bool is_monotonic = true;
+ static const bool is_steady = true;
static time_point now()
{
using namespace std::chrono;
return time_point(duration_cast<duration>(
- monotonic_clock::now().time_since_epoch()
+ steady_clock::now().time_since_epoch()
));
}
};
Modified: libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until_pred.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until_pred.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until_pred.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.condition/thread.condition.condvarany/wait_until_pred.pass.cpp Sat Nov 20 13:16:30 2010
@@ -29,13 +29,13 @@
typedef duration::rep rep;
typedef duration::period period;
typedef std::chrono::time_point<Clock> time_point;
- static const bool is_monotonic = true;
+ static const bool is_steady = true;
static time_point now()
{
using namespace std::chrono;
return time_point(duration_cast<duration>(
- monotonic_clock::now().time_since_epoch()
+ steady_clock::now().time_since_epoch()
));
}
};
Modified: libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp Sat Nov 20 13:16:30 2010
@@ -21,7 +21,7 @@
std::timed_mutex m;
-typedef std::chrono::monotonic_clock Clock;
+typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
Modified: libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp Sat Nov 20 13:16:30 2010
@@ -21,7 +21,7 @@
std::timed_mutex m;
-typedef std::chrono::monotonic_clock Clock;
+typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
Modified: libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp Sat Nov 20 13:16:30 2010
@@ -36,7 +36,7 @@
int main()
{
- typedef std::chrono::monotonic_clock Clock;
+ typedef std::chrono::steady_clock Clock;
std::unique_lock<mutex> lk(m, std::defer_lock);
assert(lk.try_lock_until(Clock::now()) == true);
assert(try_lock_until_called == true);
Modified: libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_for.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_for.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_for.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_for.pass.cpp Sat Nov 20 13:16:30 2010
@@ -21,7 +21,7 @@
std::timed_mutex m;
-typedef std::chrono::monotonic_clock Clock;
+typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
Modified: libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_until.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_until.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_until.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.class/try_lock_until.pass.cpp Sat Nov 20 13:16:30 2010
@@ -21,7 +21,7 @@
std::timed_mutex m;
-typedef std::chrono::monotonic_clock Clock;
+typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
Modified: libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp Sat Nov 20 13:16:30 2010
@@ -21,7 +21,7 @@
std::recursive_timed_mutex m;
-typedef std::chrono::monotonic_clock Clock;
+typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
Modified: libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp (original)
+++ libcxx/trunk/test/thread/thread.mutex/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp Sat Nov 20 13:16:30 2010
@@ -21,7 +21,7 @@
std::recursive_timed_mutex m;
-typedef std::chrono::monotonic_clock Clock;
+typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
Modified: libcxx/trunk/test/utilities/time/clock.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/time/clock.h?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/time/clock.h (original)
+++ libcxx/trunk/test/utilities/time/clock.h Sat Nov 20 13:16:30 2010
@@ -9,7 +9,7 @@
typedef duration::rep rep;
typedef duration::period period;
typedef std::chrono::time_point<Clock, duration> time_point;
- static const bool is_monotonic = false;
+ static const bool is_steady = false;
static time_point now();
};
Modified: libcxx/trunk/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp (original)
+++ libcxx/trunk/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp Sat Nov 20 13:16:30 2010
@@ -21,5 +21,5 @@
static_assert((std::is_same<C::rep, C::duration::rep>::value), "");
static_assert((std::is_same<C::period, C::duration::period>::value), "");
static_assert((std::is_same<C::duration, C::time_point::duration>::value), "");
- static_assert(C::is_monotonic || !C::is_monotonic, "");
+ static_assert(C::is_steady || !C::is_steady, "");
}
Modified: libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp (original)
+++ libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp Sat Nov 20 13:16:30 2010
@@ -9,7 +9,7 @@
// <chrono>
-// monotonic_clock
+// steady_clock
// check clock invariants
@@ -17,9 +17,9 @@
int main()
{
- typedef std::chrono::monotonic_clock C;
+ typedef std::chrono::steady_clock C;
static_assert((std::is_same<C::rep, C::duration::rep>::value), "");
static_assert((std::is_same<C::period, C::duration::period>::value), "");
static_assert((std::is_same<C::duration, C::time_point::duration>::value), "");
- static_assert(C::is_monotonic, "");
+ static_assert(C::is_steady, "");
}
Modified: libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp (original)
+++ libcxx/trunk/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp Sat Nov 20 13:16:30 2010
@@ -9,7 +9,7 @@
// <chrono>
-// monotonic_clock
+// steady_clock
// static time_point now();
@@ -18,7 +18,7 @@
int main()
{
- typedef std::chrono::monotonic_clock C;
+ typedef std::chrono::steady_clock C;
C::time_point t1 = C::now();
C::time_point t2 = C::now();
assert(t2 >= t1);
Modified: libcxx/trunk/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp?rev=119909&r1=119908&r2=119909&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp (original)
+++ libcxx/trunk/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp Sat Nov 20 13:16:30 2010
@@ -22,5 +22,5 @@
static_assert((std::is_same<C::period, C::duration::period>::value), "");
static_assert((std::is_same<C::duration, C::time_point::duration>::value), "");
static_assert((std::is_same<C::time_point::clock, C>::value), "");
- static_assert((C::is_monotonic || !C::is_monotonic), "");
+ static_assert((C::is_steady || !C::is_steady), "");
}
More information about the cfe-commits
mailing list