APM:Libraries
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 
10 public:
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
bool take(uint32_t timeout_ms)
Definition: Semaphores.cpp:17
pthread_mutex_t _lock
Definition: Semaphores.h:18