summaryrefslogtreecommitdiff
path: root/docs/application/thread.md
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-06-12 15:22:19 -0400
committernodist <kevin.comas.git@gmail.com>2026-06-12 15:22:19 -0400
commit89418faafd87cbbf0b36bc8bf916904a170073f6 (patch)
treeea5b619a973ad83715de82a432565fba988a535f /docs/application/thread.md
parent20a19f433956f063d8048f032aaf5dcce1d61e7c (diff)
use gnu23
Diffstat (limited to 'docs/application/thread.md')
-rw-r--r--docs/application/thread.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/application/thread.md b/docs/application/thread.md
index 95bd450..a6b77e6 100644
--- a/docs/application/thread.md
+++ b/docs/application/thread.md
@@ -10,8 +10,8 @@ typedef struct _kpl_task kpl_task;
typedef void kpl_task_fn(kpl_task *t);
typedef struct _kpl_task {
- POOL_HEADER(_kpl_task);
- _Atomic bool next_ready;
+ KPL_POOL_HEADER(_kpl_task);
+ atomic_flag next_ready;
uint16_t thread_id;
kpl_task_fn *fn;
kpl_group *state;
@@ -20,7 +20,7 @@ typedef struct _kpl_task {
} kpl_task;
typedef struct {
- _Atomic bool gc_wait;
+ atomic_flag gc_wait;
kpl_task *queue_head, *queue_tail;
pthread_t thread;
} kpl_thread;
@@ -29,13 +29,13 @@ typedef struct {
static int32_t available_threads; // find with sched_getaffinity
-static _Atomic int32_t running_threads; // init to available_threads
+static atomic_int_fast32_t running_threads; // init to available_threads
static kpl_task *async_queue_head, *async_queue_tail;
-static pthread_mutex_t async_mutex;
+static pthread_mutex_t async_queue_mutex;
-static pthread_cond_t async_cond;
+static pthread_cond_t async_queue_cond;
static kpl_thread threads[KPL_MAX_THREADS];
```