Commit Graph

2 Commits

Author SHA1 Message Date
Ewout van Bekkum
9618d8a770 pw_sync: Adds semaphores & mutexes
Adds the BinarySemaphore, CountingSemaphore, and Mutex to the
pw_sync module along with an STL backend for each.

Change-Id: I54a3a64e702202a319ed2c9068bf37412d3fd240
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24241
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
2020-12-01 21:28:25 +00:00
Ewout van Bekkum
58901934cd pw_sync: Adds initial SpinLock primitive
Adds the first synchronization primitive to Pigweed: the
pw::sync::SpinLock with integrated local interrupt
masking.

This also provides the first backend for the SpinLock facade
backed by an STL implementation. Note that signals are considered
"NMIs" while spin locks are only supported up to IRQs, ergo no
local interrupt/signal masking is done in the STL implementation.

Change-Id: I34204835c55e54597077d40665f61715964803f9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25802
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
2020-11-24 19:02:43 +00:00