Device:: Move to POSIX semaphore abstraction

This commit is contained in:
Lorenz Meier
2015-09-20 00:27:41 +02:00
parent d73deabf5c
commit 76508ab5b5
5 changed files with 22 additions and 38 deletions
+3 -3
View File
@@ -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 &);