APM:Libraries
libraries
AP_HAL_VRBRAIN
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_VRBRAIN
6
#include "
AP_HAL_VRBRAIN.h
"
7
#include <pthread.h>
8
9
class
VRBRAIN::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
VRBRAIN::Semaphore::take
bool take(uint32_t timeout_ms)
Definition:
Semaphores.cpp:17
VRBRAIN::Semaphore::Semaphore
Semaphore()
Definition:
Semaphores.h:11
AP_HAL::Semaphore
Definition:
Semaphores.h:7
VRBRAIN::Semaphore
Definition:
Semaphores.h:9
VRBRAIN::Semaphore::give
bool give()
Definition:
Semaphores.cpp:12
AP_HAL_VRBRAIN.h
VRBRAIN::Semaphore::take_nonblocking
bool take_nonblocking()
Definition:
Semaphores.cpp:39
AP_HAL_Boards.h
VRBRAIN::Semaphore::_lock
pthread_mutex_t _lock
Definition:
Semaphores.h:18
Generated on Sun Jun 17 2018 14:18:48 for APM:Libraries by
1.8.13