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

@ -5,7 +5,7 @@ macro_rules! do_test_u8 {
let periods: u32 = $periods;
let counter: u8 = $counter;
let expected: u32 = $expected;
let actual: u32 = calculate_now(periods, || counter);
let actual: u32 = calculate_now(|| periods, || counter);
assert_eq!(
actual, expected,
"Expected: ({} | {}) => {}, got: {}",
@ -19,7 +19,7 @@ macro_rules! do_test_u16 {
let periods: u16 = $periods;
let counter: u16 = $counter;
let expected: u32 = $expected;
let actual: u32 = calculate_now(periods, || counter);
let actual: u32 = calculate_now(|| periods, || counter);
assert_eq!(
actual, expected,
"Expected: ({} | {}) => {}, got: {}",