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

Go to the source code of this file.

Data Structures

struct  kmutex
 

Typedefs

typedef struct kmutex kmutex
 

Functions

KAPI b8 kmutex_create (kmutex *out_mutex)
 
KAPI void kmutex_destroy (kmutex *mutex)
 Destroys the provided mutex. More...
 
KAPI b8 kmutex_lock (kmutex *mutex)
 
KAPI b8 kmutex_unlock (kmutex *mutex)
 

Typedef Documentation

◆ kmutex

typedef struct kmutex kmutex

A mutex to be used for synchronization purposes. A mutex (or mutual exclusion) is used to limit access to a resource when there are multiple threads of execution around that resource.

Function Documentation

◆ kmutex_create()

KAPI b8 kmutex_create ( kmutex out_mutex)

Creates a mutex.

Parameters
out_mutexA pointer to hold the created mutex.
Returns
True if created successfully; otherwise false.

◆ kmutex_destroy()

KAPI void kmutex_destroy ( kmutex mutex)

Destroys the provided mutex.

Parameters
mutexA pointer to the mutex to be destroyed.

◆ kmutex_lock()

KAPI b8 kmutex_lock ( kmutex mutex)

Creates a mutex lock.

Parameters
mutexA pointer to the mutex.
Returns
True if locked successfully; otherwise false.

◆ kmutex_unlock()

KAPI b8 kmutex_unlock ( kmutex mutex)

Unlocks the given mutex.

Parameters
mutexThe mutex to unlock.
Returns
True if unlocked successfully; otherwise false.