Commit 9e809b20 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #290 from dtmuller/add-set-runnable

Add missing isRunnable implementation
parents 8e0686e1 2225d331
...@@ -253,7 +253,7 @@ void EventLoop::run(uint maxTurnCount) { ...@@ -253,7 +253,7 @@ void EventLoop::run(uint maxTurnCount) {
} }
} }
setRunnable(head != nullptr); setRunnable(isRunnable());
} }
bool EventLoop::turn() { bool EventLoop::turn() {
...@@ -288,6 +288,10 @@ bool EventLoop::turn() { ...@@ -288,6 +288,10 @@ bool EventLoop::turn() {
} }
} }
bool EventLoop::isRunnable() {
return head != nullptr;
}
void EventLoop::setRunnable(bool runnable) { void EventLoop::setRunnable(bool runnable) {
if (runnable != lastRunnableState) { if (runnable != lastRunnableState) {
port.setRunnable(runnable); port.setRunnable(runnable);
...@@ -329,7 +333,7 @@ void waitImpl(Own<_::PromiseNode>&& node, _::ExceptionOrValue& result, WaitScope ...@@ -329,7 +333,7 @@ void waitImpl(Own<_::PromiseNode>&& node, _::ExceptionOrValue& result, WaitScope
} }
} }
loop.setRunnable(loop.head != nullptr); loop.setRunnable(loop.isRunnable());
node->get(result); node->get(result);
KJ_IF_MAYBE(exception, kj::runCatchingExceptions([&]() { KJ_IF_MAYBE(exception, kj::runCatchingExceptions([&]() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment