Commit Graph

3 Commits

Author SHA1 Message Date
Ewout van Bekkum
ae6c03a95e pw_thread_freertos: adds thread creation
Adds pw:🧵:Thread creation for FreeRTOS.

Note that this also refactors the pw_thread thread facade tests
to use binary semaphores and adds a helper method to re-use
test threads even if detached. Note that this is by definition
flaky without join, ergo excessive target specific sleeps are
used when needed.

Change-Id: I3f2344c7a6ddbafa6781914991d6378e05ad0106
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30921
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-03-02 01:17:11 +00:00
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
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