diff options
Diffstat (limited to 'docs/application/thread.md')
| -rw-r--r-- | docs/application/thread.md | 12 |
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]; ``` |
