|
Kore 3
|
Provides mutexes which are used to synchronize threads and uber-mutexes which are used to synchronize processes. More...
Go to the source code of this file.
Data Structures | |
| struct | kore_mutex |
| struct | kore_uber_mutex |
Typedefs | |
| typedef struct kore_mutex | kore_mutex |
| typedef struct kore_uber_mutex | kore_uber_mutex |
Functions | |
| KORE_FUNC void | kore_mutex_init (kore_mutex *mutex) |
| Initializes a mutex-object. | |
| KORE_FUNC void | kore_mutex_destroy (kore_mutex *mutex) |
| Destroys a mutex-object. | |
| 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 mutex the function will only return once the mutex has been unlocked. | |
| 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_mutex_unlock (kore_mutex *mutex) |
| Unlocks the mutex which then allows other threads to lock it. | |
| KORE_FUNC bool | kore_uber_mutex_init (kore_uber_mutex *mutex, const char *name) |
| Initializes an uber-mutex-object. | |
| KORE_FUNC void | kore_uber_mutex_destroy (kore_uber_mutex *mutex) |
| Destroys an uber-mutex-obejct. | |
| KORE_FUNC void | kore_uber_mutex_lock (kore_uber_mutex *mutex) |
| Locks an uber-mutex. | |
| KORE_FUNC void | kore_uber_mutex_unlock (kore_uber_mutex *mutex) |
| Unlocks an uber-mutex. | |
Provides mutexes which are used to synchronize threads and uber-mutexes which are used to synchronize processes.
| KORE_FUNC void kore_mutex_destroy | ( | kore_mutex * | mutex | ) |
Destroys a mutex-object.
| mutex | The mutex to destroy |
| KORE_FUNC void kore_mutex_init | ( | kore_mutex * | mutex | ) |
Initializes a mutex-object.
| mutex | The mutex to initialize |
| 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 mutex the function will only return once the mutex has been unlocked.
| mutex | The mutex to lock |
| 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.
| mutex | The mutex to lock |
| KORE_FUNC void kore_mutex_unlock | ( | kore_mutex * | mutex | ) |
Unlocks the mutex which then allows other threads to lock it.
| mutex | The mutex to unlock |
| KORE_FUNC void kore_uber_mutex_destroy | ( | kore_uber_mutex * | mutex | ) |
Destroys an uber-mutex-obejct.
| mutex | The uber-mutex to destroy |
| KORE_FUNC bool kore_uber_mutex_init | ( | kore_uber_mutex * | mutex, |
| const char * | name ) |
Initializes an uber-mutex-object.
| mutex | The uber-mutex to initialize |
| name | A name assigned to the uber-mutex - uber-mutex-creation fails if an uber-mutex of that name already exists |
| KORE_FUNC void kore_uber_mutex_lock | ( | kore_uber_mutex * | mutex | ) |
Locks an uber-mutex.
| mutex | The uber-mutex to lock |
| KORE_FUNC void kore_uber_mutex_unlock | ( | kore_uber_mutex * | mutex | ) |
Unlocks an uber-mutex.
| mutex | The uber-mutex to unlock |