pw_sync: Update ScopedLocker to support std::adopt_lock
This is useful in conjunection with Lockable.try_lock(), e.g.:
pw::Status Example(bool may_block) {
if (may_block) {
mutex_.lock();
} else if (!mutex_.try_lock()) {
return pw::Status::Unavailable();
}
pw::ScopedLocker lock(mutex_, std::adopt_lock);
// ...
}
Change-Id: I6e9c43ac18d9877917fd83379b6b3067a791806d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/446252
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.