Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_HAL: clarify semaphore recursion #28996

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions libraries/AP_HAL/Semaphores.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading