25 lines
301 B
C++
25 lines
301 B
C++
//
|
|
// Created by epagris on 2021. 09. 12..
|
|
//
|
|
|
|
#include "Semaphore.h"
|
|
|
|
#ifdef __linux__
|
|
|
|
Semaphore::Semaphore() {
|
|
sem_init(&mSem, 0, 0);
|
|
}
|
|
|
|
Semaphore::~Semaphore() {
|
|
sem_destroy(&mSem);
|
|
}
|
|
|
|
void Semaphore::post() {
|
|
sem_post(&mSem);
|
|
}
|
|
|
|
void Semaphore::wait() {
|
|
sem_wait(&mSem);
|
|
}
|
|
|
|
#endif |