APM:Libraries
libraries
AP_HAL_PX4
Semaphores.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
AP_HAL/AP_HAL_Boards.h
>
4
5
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
6
#include "
AP_HAL_PX4.h
"
7
#include <pthread.h>
8
9
class
PX4::Semaphore
:
public
AP_HAL::Semaphore
{
10
public
:
11
Semaphore
() {
12
pthread_mutex_init(&
_lock
,
nullptr
);
13
}
14
bool
give
();
15
bool
take
(uint32_t timeout_ms);
16
bool
take_nonblocking
();
17
private
:
18
pthread_mutex_t
_lock
;
19
};
20
#endif // CONFIG_HAL_BOARD
PX4::Semaphore::give
bool give()
Definition:
Semaphores.cpp:12
PX4::Semaphore::take
bool take(uint32_t timeout_ms)
Definition:
Semaphores.cpp:17
PX4::Semaphore::_lock
pthread_mutex_t _lock
Definition:
Semaphores.h:18
PX4::Semaphore::take_nonblocking
bool take_nonblocking()
Definition:
Semaphores.cpp:39
AP_HAL_PX4.h
AP_HAL::Semaphore
Definition:
Semaphores.h:7
PX4::Semaphore
Definition:
Semaphores.h:9
PX4::Semaphore::Semaphore
Semaphore()
Definition:
Semaphores.h:11
AP_HAL_Boards.h
Generated on Sun Jun 17 2018 14:18:48 for APM:Libraries by
1.8.13