diff --git a/libraries/AP_HAL/Semaphores.h b/libraries/AP_HAL/Semaphores.h index 2394d58f18..00e3e335a9 100644 --- a/libraries/AP_HAL/Semaphores.h +++ b/libraries/AP_HAL/Semaphores.h @@ -1,20 +1,18 @@ -#ifndef __AP_HAL_SEMAPHORE_H__ -#define __AP_HAL_SEMAPHORE_H__ +#ifndef __AP_HAL_SEMAPHORES_H__ +#define __AP_HAL_SEMAPHORES_H__ #include +#include + +#define HAL_SEMAPHORE_BLOCK_FOREVER UINT32_MAX + class AP_HAL::Semaphore { public: - // get - to claim ownership of the semaphore - virtual bool get(void* caller) = 0; - - // release - to give up ownership of the semaphore - virtual bool release(void* caller) = 0; - - // call_on_release - returns true if caller successfully added to the - // queue to be called back - virtual bool call_on_release(void* caller, AP_HAL::Proc k) = 0; + virtual bool take(uint32_t timeout_ms) = 0; + virtual bool take_nonblocking() = 0; + virtual bool give() = 0; }; -#endif // __AP_HAL_SEMAPHORE_H__ +#endif // __AP_HAL_SEMAPHORES_H__