Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@rmacnak-google
Copy link
Contributor

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the new target time is less than the last wake, the loop will wake up too late.

I am working on a similar patch that keeps track of the wake times.

@rmacnak-google
Copy link
Contributor Author

PTAL. Addressed the case of a new task being due sooner. Releasing the mutex before calling WakeUp.

@Hixie
Copy link
Contributor

Hixie commented Jun 26, 2017

This seems eminently unit-testable, any chance we could test it?

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic reads fine to me. We already have unit tests setup for message loops. https://github.com/flutter/engine/blob/c920002508e9ff60a83a30087c8634af9462f9f0/fml/message_loop_unittests.cc. Can we add tests that assert the number of times a wake was called as well as asserting that there aren't any spurious wakes. I am more concerned about the latter case.

@rmacnak-google
Copy link
Contributor Author

PTAL.

  • Added assert again spurious wakeup.
  • Added fml_unittests to run_tests.sh
  • Added unit test for needing a sooner wakeup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants