ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
thread.h File Reference

WASM stub for thread.h - avoids including pthread.h which has Emscripten-incompatible attributes. More...

Go to the source code of this file.

Macros

#define asciichat_thread_create(thread_ptr, attr, start_routine, arg)   ASCIICHAT_OK
 
#define asciichat_thread_join(thread, timeout_ms)   ASCIICHAT_OK
 
#define asciichat_thread_detach(thread)   ASCIICHAT_OK
 
#define asciichat_thread_self()   ((asciichat_thread_t)NULL)
 
#define asciichat_thread_equal(t1, t2)   (t1 == t2)
 
#define asciichat_thread_exit(status)   ((void)0)
 
#define asciichat_thread_initialized(thread)   false
 
#define thread_id_self()   ((thread_id_t)NULL)
 
#define thread_id_equal(id1, id2)   (id1 == id2)
 
#define tls_key_create(key_ptr)   ASCIICHAT_OK
 
#define tls_key_delete(key)   ((void)0)
 
#define tls_getspecific(key)   ((void *)NULL)
 
#define tls_setspecific(key, value)   ASCIICHAT_OK
 

Typedefs

typedef void * asciichat_thread_t
 
typedef void * thread_id_t
 
typedef void * tls_key_t
 

Detailed Description

WASM stub for thread.h - avoids including pthread.h which has Emscripten-incompatible attributes.

In WASM, we don't support actual threads. This provides type definitions that allow the code to compile without including the system pthread.h, which has attributes like 'regparm' that Emscripten doesn't support.

Definition in file lib/platform/wasm/stubs/thread.h.

Macro Definition Documentation

◆ asciichat_thread_create

#define asciichat_thread_create (   thread_ptr,
  attr,
  start_routine,
  arg 
)    ASCIICHAT_OK

Definition at line 21 of file lib/platform/wasm/stubs/thread.h.

◆ asciichat_thread_detach

#define asciichat_thread_detach (   thread)    ASCIICHAT_OK

Definition at line 23 of file lib/platform/wasm/stubs/thread.h.

◆ asciichat_thread_equal

#define asciichat_thread_equal (   t1,
  t2 
)    (t1 == t2)

Definition at line 25 of file lib/platform/wasm/stubs/thread.h.

◆ asciichat_thread_exit

#define asciichat_thread_exit (   status)    ((void)0)

Definition at line 26 of file lib/platform/wasm/stubs/thread.h.

◆ asciichat_thread_initialized

#define asciichat_thread_initialized (   thread)    false

Definition at line 27 of file lib/platform/wasm/stubs/thread.h.

◆ asciichat_thread_join

#define asciichat_thread_join (   thread,
  timeout_ms 
)    ASCIICHAT_OK

Definition at line 22 of file lib/platform/wasm/stubs/thread.h.

◆ asciichat_thread_self

#define asciichat_thread_self (   void)    ((asciichat_thread_t)NULL)

Definition at line 24 of file lib/platform/wasm/stubs/thread.h.

◆ thread_id_equal

#define thread_id_equal (   id1,
  id2 
)    (id1 == id2)

Definition at line 30 of file lib/platform/wasm/stubs/thread.h.

◆ thread_id_self

#define thread_id_self ( )    ((thread_id_t)NULL)

Definition at line 29 of file lib/platform/wasm/stubs/thread.h.

◆ tls_getspecific

#define tls_getspecific (   key)    ((void *)NULL)

Definition at line 34 of file lib/platform/wasm/stubs/thread.h.

◆ tls_key_create

#define tls_key_create (   key_ptr)    ASCIICHAT_OK

Definition at line 32 of file lib/platform/wasm/stubs/thread.h.

◆ tls_key_delete

#define tls_key_delete (   key)    ((void)0)

Definition at line 33 of file lib/platform/wasm/stubs/thread.h.

◆ tls_setspecific

#define tls_setspecific (   key,
  value 
)    ASCIICHAT_OK

Definition at line 35 of file lib/platform/wasm/stubs/thread.h.

Typedef Documentation

◆ asciichat_thread_t

typedef void* asciichat_thread_t

Definition at line 16 of file lib/platform/wasm/stubs/thread.h.

◆ thread_id_t

typedef void* thread_id_t

Definition at line 17 of file lib/platform/wasm/stubs/thread.h.

◆ tls_key_t

typedef void* tls_key_t

Definition at line 18 of file lib/platform/wasm/stubs/thread.h.