2012-12-14 21:55:38 -04:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_EMPTY_SEMAPHORE_H__
|
|
|
|
#define __AP_HAL_EMPTY_SEMAPHORE_H__
|
|
|
|
|
|
|
|
#include <AP_HAL_Empty.h>
|
|
|
|
|
|
|
|
class Empty::EmptySemaphore : public AP_HAL::Semaphore {
|
2012-12-17 15:07:26 -04:00
|
|
|
public:
|
2013-01-02 20:44:23 -04:00
|
|
|
EmptySemaphore() : _taken(false) {}
|
|
|
|
bool give();
|
|
|
|
bool take(uint32_t timeout_ms);
|
|
|
|
bool take_nonblocking();
|
2012-12-17 15:07:26 -04:00
|
|
|
private:
|
2013-01-02 20:44:23 -04:00
|
|
|
bool _taken;
|
2012-12-14 21:55:38 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_HAL_EMPTY_SEMAPHORE_H__
|