Kore 3
Loading...
Searching...
No Matches
mutex.h
Go to the documentation of this file.
1#ifndef KORE_THREADS_MUTEX_HEADER
2#define KORE_THREADS_MUTEX_HEADER
3
4#include <kore3/global.h>
5
6#include <kore3/backend/mutex.h>
7
8#include <stdbool.h>
9
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18typedef struct kore_mutex {
19 kore_mutex_impl impl;
21
26KORE_FUNC void kore_mutex_init(kore_mutex *mutex);
27
32KORE_FUNC void kore_mutex_destroy(kore_mutex *mutex);
33
39KORE_FUNC void kore_mutex_lock(kore_mutex *mutex);
40
46KORE_FUNC bool kore_mutex_try_to_lock(kore_mutex *mutex);
47
52KORE_FUNC void kore_mutex_unlock(kore_mutex *mutex);
53
54typedef struct kore_uber_mutex {
55 kore_uber_mutex_impl impl;
57
64KORE_FUNC bool kore_uber_mutex_init(kore_uber_mutex *mutex, const char *name);
65
71
77
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
KORE_FUNC void kore_uber_mutex_lock(kore_uber_mutex *mutex)
Locks an uber-mutex.
KORE_FUNC void kore_mutex_lock(kore_mutex *mutex)
Locks a mutex. A mutex can only be locked from one thread - when other threads attempt to lock the mu...
KORE_FUNC void kore_uber_mutex_destroy(kore_uber_mutex *mutex)
Destroys an uber-mutex-obejct.
KORE_FUNC void kore_mutex_destroy(kore_mutex *mutex)
Destroys a mutex-object.
KORE_FUNC void kore_mutex_unlock(kore_mutex *mutex)
Unlocks the mutex which then allows other threads to lock it.
KORE_FUNC void kore_mutex_init(kore_mutex *mutex)
Initializes a mutex-object.
KORE_FUNC bool kore_uber_mutex_init(kore_uber_mutex *mutex, const char *name)
Initializes an uber-mutex-object.
KORE_FUNC bool kore_mutex_try_to_lock(kore_mutex *mutex)
Attempts to lock the mutex which will only succeed if no other thread currently holds the lock.
KORE_FUNC void kore_uber_mutex_unlock(kore_uber_mutex *mutex)
Unlocks an uber-mutex.
Definition mutex.h:18
Definition mutex.h:54