Commit 533ea0cb authored by Stepan Palamarchuk's avatar Stepan Palamarchuk Committed by Facebook Github Bot

Fix handling time counters

Summary:
Currently we'll are getting incorrect Idle&Busy time counters for loops when there were no LoopCallbacks. This is because we don't properly refresh the `startWork_` and use the one from the last loop that had LoopCallbacks.

This diff fixes that by properly refreshing `startWork_` even if there're no LoopCallbacks.

Reviewed By: yfeldblum

Differential Revision: D7811127

fbshipit-source-id: 94ded08963b1bddc7b7859484f076d4c8a1e897f
parent 62e3abb2
...@@ -592,8 +592,8 @@ bool EventBase::runImmediatelyOrRunInEventBaseThreadAndWait(Func fn) { ...@@ -592,8 +592,8 @@ bool EventBase::runImmediatelyOrRunInEventBaseThreadAndWait(Func fn) {
} }
bool EventBase::runLoopCallbacks() { bool EventBase::runLoopCallbacks() {
if (!loopCallbacks_.empty()) {
bumpHandlingTime(); bumpHandlingTime();
if (!loopCallbacks_.empty()) {
// Swap the loopCallbacks_ list with a temporary list on our stack. // Swap the loopCallbacks_ list with a temporary list on our stack.
// This way we will only run callbacks scheduled at the time // This way we will only run callbacks scheduled at the time
// runLoopCallbacks() was invoked. // runLoopCallbacks() was invoked.
......
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