Adds documentation covering thread identification, yielding,
sleeping, and portable thread creation.
The signatures, comments, and docs are updated to reflect the most
recent terminology for describing blocking APIs with timeouts and
deadlines.
Change-Id: I5d802335d3e52416131ad437ef8bfa19e04e637b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/60042
Reviewed-by: Keir Mierle <keir@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
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>