Fix race condition in calculate_now (#860)

* Fix race condition in calculate_now

* Add changelog

* Update changelog

* Refine comment

* More comment fixes
This commit is contained in:
Finomnis 2023-12-06 19:36:09 +01:00 committed by GitHub
parent f377471e44
commit bbed945285
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 27 additions and 15 deletions

View file

@ -212,7 +212,7 @@ macro_rules! make_timer {
let gpt = unsafe{ $timer::instance() };
Self::Instant::from_ticks(calculate_now(
$period.load(Ordering::Relaxed),
|| $period.load(Ordering::Relaxed),
|| ral::read_reg!(ral::gpt, gpt, CNT)
))
}