improve main.cc readability

This commit is contained in:
2022-09-28 13:28:27 +09:00
parent 4f13dd9456
commit c2c4b83918
3 changed files with 238 additions and 200 deletions

View File

@@ -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;

View File

@@ -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);
}
}