improve main.cc readability
This commit is contained in:
@@ -25,7 +25,6 @@ class Thread final : public nf7::Context,
|
||||
Thread(nf7::Env& env, nf7::File::Id id, Runner&& runner) noexcept :
|
||||
nf7::Context(env, id), env_(&env), runner_(std::move(runner)) {
|
||||
}
|
||||
virtual ~Thread() noexcept = default;
|
||||
Thread(const Thread&) = delete;
|
||||
Thread(Thread&&) = delete;
|
||||
Thread& operator=(const Thread&) = delete;
|
||||
|
@@ -89,12 +89,12 @@ class TimedWaitQueue final : private TimedQueue<T> {
|
||||
void Notify() noexcept {
|
||||
cv_.notify_all();
|
||||
}
|
||||
void Wait() noexcept {
|
||||
void Wait(const auto& dur) noexcept {
|
||||
std::unique_lock<std::mutex> k(mtx_);
|
||||
if (auto t = next_()) {
|
||||
cv_.wait_until(k, *t);
|
||||
} else {
|
||||
cv_.wait(k);
|
||||
cv_.wait_for(k, dur);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user