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