ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
mirror_thread_pool.c File Reference

Go to the source code of this file.

Functions

asciichat_error_t thread_pool_spawn (thread_pool_t *, void *(*)(void *), void *, int, const char *)
asciichat_error_t thread_pool_stop_all (thread_pool_t *)
 Stop all threads in the pool in stop_id order.

Function Documentation

◆ thread_pool_spawn()

asciichat_error_t thread_pool_spawn ( thread_pool_t * ,
void * *)(void *,
void * ,
int ,
const char *  )

Definition at line 3 of file mirror_thread_pool.c.

3 {
4 return SET_ERRNO(ERROR_NOT_SUPPORTED, "Native thread pool unavailable in the browser mirror");
5}
#define SET_ERRNO(code,...)
@ ERROR_NOT_SUPPORTED
Definition error_codes.h:74

References ERROR_NOT_SUPPORTED, and SET_ERRNO.

◆ thread_pool_stop_all()

asciichat_error_t thread_pool_stop_all ( thread_pool_t * pool)

Stop all threads in the pool in stop_id order.

Joins all threads in ascending stop_id order (lower values first). Threads with negative stop_id are stopped last in undefined order. This function blocks until all threads have exited.

Shutdown Sequence:

  1. Threads with stop_id >= 0 are joined in ascending order
  2. Threads with stop_id < 0 are joined in any order
  3. All thread entries are freed

After this call, the pool is empty but still valid - you can spawn new threads or destroy the pool.

Parameters
poolThread pool to stop
Returns
ASCIICHAT_OK on success, error code on failure

Definition at line 7 of file mirror_thread_pool.c.

7 {
8 return ASCIICHAT_OK;
9}
@ ASCIICHAT_OK
Definition error_codes.h:50

References ASCIICHAT_OK.