crosvm/base
Cody Schuffelen 1846ca7ec0 base: Implement base::TimerTrait on MacOS
This has two outstanding issues:

- `timerfd`'s timer repeats only after a delay, while kqueue either
  starts a one-shot timer or a repeating timer.
- `clock_getres` seems overly optimistic. It claims microsecond
  precision, while I've seen `timer::tests::one_shot` and
  `timer::tests::one_shot_cloned` return too late by up to 5
  milliseconds. Therefore these tests still fail.

`kevent64_s` is used to give larger values in the `data` field, making
it safer to always use nanosecond precision in the kqueue timer. (Using
coarser precisions doesn't seem to help the tests pass anyway.)

Test: `cargo test -p base timer -- --ignored` (still fails)
Bug: b/309020556
Change-Id: I789a0fb853b083c0466016d5a3338479dabd8b08
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5454793
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-04-16 23:34:00 +00:00
..
base_event_token_derive
src base: Implement base::TimerTrait on MacOS 2024-04-16 23:34:00 +00:00
tests
.build_test_serial
Cargo.toml Cargo.toml: Remove unused data_model deps 2024-03-13 20:00:26 +00:00