Expands comments in the backend implementations to better explain
why things are done the way they are as a reference for future
backends.
Also updates the IRQ and kernel contract asserts to consistently
debug assert the contexts.
Change-Id: I4d742c5d2eccaeb1500680405c6959c735ce351f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/67304
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Fixes the ThreadX backends for pw::sync::Mutex,
pw::sync::BinarySemaphore, pw::sync::CountingSemaphore, and
pw::this_thread::sleep_for to add one tick when invoking the native
API to comply with the for_at_least contract as we do not know how
far we are into the current tick.
Note this is not observable without the use of an independent clock.
This also adds explicit downcasting from int64_t to ULONG ticks when
invoking native APIs.
Change-Id: Ia28e0149a5c6426f7363c0467815dc3dcac0a010
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/36923
Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>