Kore
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1#pragma once
2
3#include <kinc/global.h>
4
5#include <kinc/backend/thread.h>
6
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct kinc_thread {
16 kinc_thread_impl_t impl;
17} kinc_thread_t;
18
22KINC_FUNC void kinc_threads_init(void);
23
29KINC_FUNC void kinc_threads_quit(void);
30
37KINC_FUNC void kinc_thread_init(kinc_thread_t *thread, void (*func)(void *param), void *param);
38
43KINC_FUNC void kinc_thread_wait_and_destroy(kinc_thread_t *thread);
44
50KINC_FUNC bool kinc_thread_try_to_destroy(kinc_thread_t *thread);
51
56KINC_FUNC void kinc_thread_set_name(const char *name);
57
62KINC_FUNC void kinc_thread_sleep(int milliseconds);
63
64#ifdef __cplusplus
65}
66#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
Definition thread.h:15
KINC_FUNC bool kinc_thread_try_to_destroy(kinc_thread_t *thread)
Attempts to destroy a thread.
KINC_FUNC void kinc_thread_wait_and_destroy(kinc_thread_t *thread)
Waits for the thread to complete execution and then destroys it.
KINC_FUNC void kinc_threads_init(void)
Initializes the threading system. This has to be called before calling any kinc_thread functions.
KINC_FUNC void kinc_threads_quit(void)
Shuts down the threading system.
KINC_FUNC void kinc_thread_set_name(const char *name)
Assigns a name to the current thread which will then show up in debuggers and profilers.
KINC_FUNC void kinc_thread_init(kinc_thread_t *thread, void(*func)(void *param), void *param)
Starts a thread via the provided function.
KINC_FUNC void kinc_thread_sleep(int milliseconds)
Puts the current thread to sleep.