2012-12-14 21:55:38 -04:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_EMPTY_SEMAPHORE_H__
|
|
|
|
#define __AP_HAL_EMPTY_SEMAPHORE_H__
|
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include "AP_HAL_Empty.h"
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
class Empty::Semaphore : public AP_HAL::Semaphore {
|
2012-12-17 15:07:26 -04:00
|
|
|
public:
|
2015-12-07 14:53:55 -04:00
|
|
|
Semaphore() : _taken(false) {}
|
2013-01-02 20:44:23 -04:00
|
|
|
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__
|