2012-11-28 21:53:15 -04:00
|
|
|
|
2013-01-02 20:27:01 -04:00
|
|
|
#ifndef __AP_HAL_SEMAPHORES_H__
|
|
|
|
#define __AP_HAL_SEMAPHORES_H__
|
2012-11-28 21:53:15 -04:00
|
|
|
|
|
|
|
#include <AP_HAL_Namespace.h>
|
|
|
|
|
2013-01-04 20:19:15 -04:00
|
|
|
#define HAL_SEMAPHORE_BLOCK_FOREVER ((uint32_t) 0xFFFFFFFF)
|
2012-11-28 21:53:15 -04:00
|
|
|
|
2013-01-02 20:27:01 -04:00
|
|
|
class AP_HAL::Semaphore {
|
|
|
|
public:
|
|
|
|
virtual bool take(uint32_t timeout_ms) = 0;
|
|
|
|
virtual bool take_nonblocking() = 0;
|
|
|
|
virtual bool give() = 0;
|
2012-11-28 21:53:15 -04:00
|
|
|
};
|
|
|
|
|
2013-01-02 20:27:01 -04:00
|
|
|
#endif // __AP_HAL_SEMAPHORES_H__
|