Commit Graph

3 Commits

Author SHA1 Message Date
Ewout van Bekkum
0f3901eda4 pw_thread: adds thread creation
Adds a std::thread like API through a new pw_thread facade based
on the STL's std::thread API, however with more restricted function
entry routine format support and backend specific option support
to permit non-portable configuration of thread settings/parameters
including static context allocations.

In addition this provides an initial set of backends based on using
the STL's std::thread directly.

Change-Id: Ib8c3cbdc434044e204e67e58d861a40e4acec9b4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30920
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
2021-02-19 21:37:16 +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
Ewout van Bekkum
e3b5603919 pw_thread: adds the initial pw_thread module
Adds a std::this_thread like API through the pw_thread facades, that
is:
1) this_thread::yield
2) this_thread::sleep_{for,until}
3) this_thread::get_id

This module is split into many different facades in order to let users
decide what functionality they want to use as they may not always
be available, for example when using opaque SDKs.

In addition this provides an initial set of backends based on using
the STL's std::this_thread directly and selects them for the host
target.

Change-Id: I0ee8e4390ba988b2b13e9ee59f976f2333715f1f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30040
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-01-28 01:47:20 +00:00