summaryrefslogtreecommitdiff
path: root/docs/application/thread.md
diff options
context:
space:
mode:
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);
}