mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 08:03:34 +08:00
Device:: Move to POSIX semaphore abstraction
This commit is contained in:
@@ -181,7 +181,7 @@ protected:
|
||||
*/
|
||||
void lock() {
|
||||
DEVICE_DEBUG("lock");
|
||||
do {} while (sem_wait(_lock) != 0);
|
||||
do {} while (px4_sem_wait(&_lock) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,11 +189,11 @@ protected:
|
||||
*/
|
||||
void unlock() {
|
||||
DEVICE_DEBUG("unlock");
|
||||
sem_post(_lock);
|
||||
px4_sem_post(&_lock);
|
||||
}
|
||||
|
||||
private:
|
||||
sem_t * _lock;
|
||||
px4_sem_t _lock;
|
||||
|
||||
/** disable copy construction for this and all subclasses */
|
||||
Device(const Device &);
|
||||
|
||||
Reference in New Issue
Block a user