commit | 2da13fa5899058bff4ae09844325efd0d9bc6c8e | [log] [tgz] |
---|---|---|
author | Ewout van Bekkum <ewout@google.com> | Wed Jan 27 16:04:10 2021 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jan 28 16:22:09 2021 +0000 |
tree | 835f58e43148b5d567d12be3ab6d3060206debde | |
parent | 749342b879423e0d8290d7295b469f889e97d2ce [diff] |
noexcept: add some noexcepts when mirroring the STL Change-Id: If139a17461644afd0262710631ca413f38f2f66e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/31040 Commit-Queue: Ewout van Bekkum <ewout@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com>
diff --git a/pw_sync_stl/binary_semaphore.cc b/pw_sync_stl/binary_semaphore.cc index f1f3fb4..fdff483 100644 --- a/pw_sync_stl/binary_semaphore.cc +++ b/pw_sync_stl/binary_semaphore.cc
@@ -33,7 +33,7 @@ native_type_.count = 0; } -bool BinarySemaphore::try_acquire() { +bool BinarySemaphore::try_acquire() noexcept { std::lock_guard lock(native_type_.mutex); if (native_type_.count != 0) { native_type_.count = 0;
diff --git a/pw_sync_stl/counting_semaphore.cc b/pw_sync_stl/counting_semaphore.cc index 781aa77..629d0dc 100644 --- a/pw_sync_stl/counting_semaphore.cc +++ b/pw_sync_stl/counting_semaphore.cc
@@ -36,7 +36,7 @@ --native_type_.count; } -bool CountingSemaphore::try_acquire() { +bool CountingSemaphore::try_acquire() noexcept { std::lock_guard lock(native_type_.mutex); if (native_type_.count != 0) { --native_type_.count;