Commit Graph

5 Commits

Author SHA1 Message Date
Ewout van Bekkum
39144b6f0f pw_thread: Extend docs and update duration/deadline terminology
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>
2021-11-17 20:32:33 +00:00
Ewout van Bekkum
b789d8f4ad pw_thread_backends: Expand comments in the implementations
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>
2021-11-08 16:29:53 +00:00
Wyatt Hepler
f298de4260 pw_assert: Switch to the new header names
Bug: 350
Change-Id: Ia395cebedba24c9463e558059ebdb516759253e2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/38740
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-04-30 00:33:37 +00:00
Ewout van Bekkum
1dea2c8e0b threadx: fix for_at_least contract to add one tick
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>
2021-03-11 02:23:26 +00:00
Ewout van Bekkum
fe5b4a7522 pw_thread_threadx: adds yield, id, and sleep backends
Adds the ThreadX backend for pw_thread's yield, sleep, and id.

Change-Id: I3aba539632b9d4dbc90b2d1498365213dd44e7cf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/31541
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-02-03 10:01:59 +00:00