ardupilot/libraries/AP_HAL_PX4/Semaphores.h

26 lines
485 B
C
Raw Normal View History

2015-12-19 17:35:13 -04:00
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#include <stdint.h>
#include <AP_HAL/AP_HAL_Macros.h>
#include <AP_HAL/Semaphores.h>
#include "AP_HAL_PX4_Namespace.h"
2015-12-19 17:35:13 -04:00
#include <pthread.h>
class PX4::Semaphore : public AP_HAL::Semaphore {
public:
2018-08-19 22:09:20 -03:00
Semaphore();
2015-12-19 17:35:13 -04:00
bool give();
bool take(uint32_t timeout_ms);
bool take_nonblocking();
2018-08-19 22:09:20 -03:00
protected:
2015-12-19 17:35:13 -04:00
pthread_mutex_t _lock;
};
2018-08-19 22:09:20 -03:00
class PX4::Semaphore_Recursive : public PX4::Semaphore {
public:
Semaphore_Recursive();
};