summaryrefslogtreecommitdiff
path: root/docs/application/thread.md
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-06-15 15:23:58 -0400
committernodist <kevin.comas.git@gmail.com>2026-06-15 15:23:58 -0400
commit47a27b0fd6eb0831a74479883ba0b4c30d226fbe (patch)
treea77cb6d6beb89a944131de701b6bb4e96b7e0003 /docs/application/thread.md
parent2ec4d95567776f8211cd4588b295415b42876e5c (diff)
memory slab as well as pooling
Diffstat (limited to 'docs/application/thread.md')
-rw-r--r--docs/application/thread.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/application/thread.md b/docs/application/thread.md
index 06410e6..231b0fe 100644
--- a/docs/application/thread.md
+++ b/docs/application/thread.md
@@ -78,6 +78,7 @@ iterator : arguments, locals, iterator functions, iterator function index
# Example
```c
+// gcc -std=gnu99 -Wall -Wextra -O2 -fhardened -fno-omit-frame-pointer -o thread_queue thread_queue.c
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
@@ -311,7 +312,7 @@ void *task_loop(void *arg) {
void task_run() {
for (int32_t thread_id = 1; thread_id < avaiable_threads; thread_id++)
pthread_create(&threads[thread_id].thread, NULL, task_loop, (void*) (intptr_t) thread_id);
- task_loop(0);
+ task_loop(MAIN_THREAD);
for (int32_t thread_id = 1; thread_id < avaiable_threads; thread_id++)
pthread_join(threads[thread_id].thread, NULL);
}