acadia/lib/mammoth/src/semaphore.cpp

12 lines
350 B
C++
Raw Normal View History

#include "mammoth/semaphore.h"
#include <zcall.h>
#include "mammoth/debug.h"
Semaphore::Semaphore() { check(ZSemaphoreCreate(&semaphore_cap_)); }
Semaphore::~Semaphore() { check(ZCapRelease(semaphore_cap_)); }
void Semaphore::Wait() { check(ZSemaphoreWait(semaphore_cap_)); }
void Semaphore::Signal() { check(ZSemaphoreSignal(semaphore_cap_)); }