ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
threading.c File Reference

Threading stubs for WASM. More...

Go to the source code of this file.

Typedefs

typedef void thread_pool_t
 

Functions

int asciichat_thread_join_timeout (asciichat_thread_t *thread, void **retval, uint64_t timeout_ns)
 Wait for a thread to complete with timeout.
 
bool asciichat_thread_is_initialized (asciichat_thread_t *thread)
 Check if a thread handle has been initialized.
 
thread_pool_t * thread_pool_create (int num_threads)
 
void thread_pool_destroy (thread_pool_t *pool)
 Destroy a thread pool.
 
int cond_init (cond_t *cond, const char *name)
 Initialize a condition variable with a name.
 
int cond_destroy (cond_t *cond)
 Destroy a condition variable.
 
int cond_signal (cond_t *cond)
 Signal a condition variable (wake one waiting thread)
 
int cond_broadcast (cond_t *cond)
 Broadcast to a condition variable (wake all waiting threads)
 
int cond_wait_impl (cond_t *cond, mutex_t *mutex)
 Wait on a condition variable (blocking) - implementation function.
 
int cond_timedwait_impl (cond_t *cond, mutex_t *mutex, uint64_t timeout_ns)
 Wait on a condition variable with timeout - implementation function.
 

Detailed Description

Threading stubs for WASM.

Definition in file stubs/threading.c.

Typedef Documentation

◆ thread_pool_t

typedef void thread_pool_t

Definition at line 24 of file stubs/threading.c.

Function Documentation

◆ thread_pool_create()

thread_pool_t * thread_pool_create ( int  num_threads)

Definition at line 26 of file stubs/threading.c.

26 {
27 (void)num_threads;
28 return NULL;
29}

Referenced by acds_server_init(), server_main(), and tcp_server_add_client().

◆ thread_pool_destroy()

void thread_pool_destroy ( thread_pool_t *  pool)

Destroy a thread pool.

Stops all threads (if not already stopped), waits for them to exit, and frees all pool resources. It's safe to call this even if threads are still running - they will be stopped first.

Parameters
poolThread pool to destroy (NULL is safe, does nothing)

Definition at line 31 of file stubs/threading.c.

31 {
32 (void)pool;
33}
buffer_pool_t * pool

References pool.

Referenced by acds_server_shutdown(), tcp_server_destroy(), tcp_server_remove_client(), and websocket_server_destroy().