AP_Common: added #pragma once to Semaphores.h

This commit is contained in:
Andrew Tridgell 2018-08-20 11:19:22 +10:00
parent dc20e2baed
commit 0aeceb22d9
1 changed files with 9 additions and 0 deletions

View File

@ -14,10 +14,19 @@
*/
#pragma once
#pragma once
/*
a method to make semaphores less error prone. The WITH_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.
The WITH_SEMAPHORE() macro can be used with either type of semaphore
*/
class WithSemaphore {
public: