diff --git a/include/ircd/ctx/ctx.h b/include/ircd/ctx/ctx.h index 4fe251306..747da6b41 100644 --- a/include/ircd/ctx/ctx.h +++ b/include/ircd/ctx/ctx.h @@ -34,9 +34,6 @@ /// namespace ircd::ctx { - using std::chrono::steady_clock; - using time_point = steady_clock::time_point; - struct ctx; IRCD_EXCEPTION(ircd::error, error) diff --git a/include/ircd/ctx/this_ctx.h b/include/ircd/ctx/this_ctx.h index a532ab07e..4b51aa50d 100644 --- a/include/ircd/ctx/this_ctx.h +++ b/include/ircd/ctx/this_ctx.h @@ -33,12 +33,12 @@ inline namespace this_ctx template throw_overload wait(const duration &); // Returns false if notified; true if time point reached, timeout thrown on throw_overloads - bool wait_until(const time_point &tp, const std::nothrow_t &); - template nothrow_overload wait_until(const time_point &tp); - template throw_overload wait_until(const time_point &tp); + bool wait_until(const steady_point &tp, const std::nothrow_t &); + template nothrow_overload wait_until(const steady_point &tp); + template throw_overload wait_until(const steady_point &tp); // Ignores notes. Throws if interrupted. - void sleep_until(const time_point &tp); + void sleep_until(const steady_point &tp); template void sleep(const duration &); void sleep(const int &secs); }} @@ -74,10 +74,10 @@ ircd::ctx::this_ctx::sleep(const duration &d) /// interruption point. template ircd::throw_overload -ircd::ctx::this_ctx::wait_until(const time_point &tp) +ircd::ctx::this_ctx::wait_until(const steady_point &tp) { if(wait_until(tp)) - throw E(); + throw E{}; } /// Wait for a notification until a point in time. If there is a notification @@ -85,7 +85,7 @@ ircd::ctx::this_ctx::wait_until(const time_point &tp) /// interruption point. this is not noexcept. template ircd::nothrow_overload -ircd::ctx::this_ctx::wait_until(const time_point &tp) +ircd::ctx::this_ctx::wait_until(const steady_point &tp) { return wait_until(tp, std::nothrow); } @@ -100,7 +100,9 @@ ircd::throw_overload ircd::ctx::this_ctx::wait(const duration &d) { const auto ret(wait(d)); - return ret <= duration(0)? throw E() : ret; + return ret <= duration(0)? + throw E{}: + ret; } /// Wait for a notification for some amount of time. This function returns