ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
lib/platform/wasm/stubs/thread.h
Go to the documentation of this file.
1#pragma once
2
12#include <stdbool.h>
13#include <stdint.h>
14
15/* WASM doesn't have real threads, so we use void* placeholders */
16typedef void *asciichat_thread_t;
17typedef void *thread_id_t;
18typedef void *tls_key_t;
19
20/* Stub functions that do nothing in WASM */
21#define asciichat_thread_create(thread_ptr, attr, start_routine, arg) ASCIICHAT_OK
22#define asciichat_thread_join(thread, timeout_ms) ASCIICHAT_OK
23#define asciichat_thread_detach(thread) ASCIICHAT_OK
24#define asciichat_thread_self() ((asciichat_thread_t)NULL)
25#define asciichat_thread_equal(t1, t2) (t1 == t2)
26#define asciichat_thread_exit(status) ((void)0)
27#define asciichat_thread_initialized(thread) false
28
29#define thread_id_self() ((thread_id_t)NULL)
30#define thread_id_equal(id1, id2) (id1 == id2)
31
32#define tls_key_create(key_ptr) ASCIICHAT_OK
33#define tls_key_delete(key) ((void)0)
34#define tls_getspecific(key) ((void *)NULL)
35#define tls_setspecific(key, value) ASCIICHAT_OK
void * asciichat_thread_t
ClangTool/LibTooling compatibility shim for stdbool.h.