Kohi Game Engine
ksemaphore.h File Reference
#include "defines.h"

Go to the source code of this file.

Data Structures

struct  ksemaphore
 

Typedefs

typedef struct ksemaphore ksemaphore
 

Functions

KAPI b8 ksemaphore_create (ksemaphore *out_semaphore, u32 max_count, u32 start_count)
 
KAPI void ksemaphore_destroy (ksemaphore *semaphore)
 
KAPI b8 ksemaphore_signal (ksemaphore *semaphore)
 
KAPI b8 ksemaphore_wait (ksemaphore *semaphore, u64 timeout_ms)
 

Typedef Documentation

◆ ksemaphore

typedef struct ksemaphore ksemaphore

Function Documentation

◆ ksemaphore_create()

KAPI b8 ksemaphore_create ( ksemaphore out_semaphore,
u32  max_count,
u32  start_count 
)

◆ ksemaphore_destroy()

KAPI void ksemaphore_destroy ( ksemaphore semaphore)

◆ ksemaphore_signal()

KAPI b8 ksemaphore_signal ( ksemaphore semaphore)

◆ ksemaphore_wait()

KAPI b8 ksemaphore_wait ( ksemaphore semaphore,
u64  timeout_ms 
)

Decreases the semaphore count by 1. If the count reaches 0, the semaphore is considered unsignaled and this call blocks until the semaphore is signaled by ksemaphore_signal.