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:
|
2013-01-09 05:42:02 -04:00
|
|
|
virtual bool take(uint32_t timeout_ms) WARN_IF_UNUSED = 0 ;
|
|
|
|
virtual bool take_nonblocking() WARN_IF_UNUSED = 0;
|
2013-01-02 20:27:01 -04:00
|
|
|
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__
|