mirror of
https://github.com/switchbrew/libnx.git
synced 2025-12-30 06:48:38 +01:00
25 lines
474 B
C
25 lines
474 B
C
/**
|
|
* @file semaphore.h
|
|
* @brief Thread synchronization based on Mutex.
|
|
* @author Kevoot
|
|
* @copyright libnx Authors
|
|
*/
|
|
#pragma once
|
|
|
|
#include "mutex.h"
|
|
|
|
typedef struct Semaphore
|
|
{
|
|
bool is_up;
|
|
Mutex mutex;
|
|
} Semaphore;
|
|
|
|
void semaphoreInit(Semaphore *);
|
|
/* TODO */
|
|
void semaphorePost(Semaphore *);
|
|
void semaphoreUp(Semaphore *);
|
|
void semaphoreDown(Semaphore *);
|
|
void semaphoreWait(Semaphore *);
|
|
void semaphoreWaitUp(Semaphore *);
|
|
bool semaphoreIsUp(Semaphore *);
|