pw_sync: use timeout & deadline over {until,for}_at_least
The signatures, comments, and docs are updated to reflect the most
recent terminology for describing blocking APIs with timeouts and
deadlines.
Change-Id: Iea7ea5490c44c9ce698a694e532345909bba562f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/60040
Reviewed-by: Keir Mierle <keir@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
diff --git a/pw_sync_stl/counting_semaphore.cc b/pw_sync_stl/counting_semaphore.cc
index b7f0721..95de84b 100644
--- a/pw_sync_stl/counting_semaphore.cc
+++ b/pw_sync_stl/counting_semaphore.cc
@@ -45,11 +45,10 @@
return false;
}
-bool CountingSemaphore::try_acquire_until(
- SystemClock::time_point until_at_least) {
+bool CountingSemaphore::try_acquire_until(SystemClock::time_point deadline) {
std::unique_lock lock(native_type_.mutex);
if (native_type_.condition.wait_until(
- lock, until_at_least, [&] { return native_type_.count != 0; })) {
+ lock, deadline, [&] { return native_type_.count != 0; })) {
--native_type_.count;
return true;
}