From ab716ca4f9329e2e7b9929b791ea146a55339fc8 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 2 Jan 2025 20:34:04 -0600 Subject: [PATCH] AP_HAL: clarify semaphore recursion We haven't had non-recursive semaphores since PR #13323 (commits 1284f1bd8a73cc16b1407f89652d68339947caf9). --- libraries/AP_HAL/Semaphores.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/AP_HAL/Semaphores.h b/libraries/AP_HAL/Semaphores.h index 34e8ff93fb86a5..1159844b01a872 100644 --- a/libraries/AP_HAL/Semaphores.h +++ b/libraries/AP_HAL/Semaphores.h @@ -32,12 +32,11 @@ class AP_HAL::Semaphore { macro will block forever for a semaphore, and will automatically release the semaphore when it goes out of scope - Note that we have two types of semaphores. A normal semaphore can - only be taken once. A recursive semaphore allows for the thread - holding the semaphore to take it again. It must be released the same - number of times it is taken. + All semaphores are recursive. This allows for the thread holding + the semaphore to take it again. It must be released the same number + of times it is taken. - The WITH_SEMAPHORE() macro can be used with either type of semaphore + The WITH_SEMAPHORE() macro cannot be used with binary semaphores */ class WithSemaphore {