ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
thread.c File Reference

🧵 Thread utilities and helpers More...

Go to the source code of this file.

Functions

asciichat_error_t thread_create_or_fail (asciichat_thread_t *thread, void *(*func)(void *), void *arg, const char *thread_name, uint32_t client_id)
 

Detailed Description

🧵 Thread utilities and helpers

Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
December 2025

Definition in file thread.c.

Function Documentation

◆ thread_create_or_fail()

asciichat_error_t thread_create_or_fail ( asciichat_thread_t *  thread,
void *(*)(void *)  func,
void *  arg,
const char *  thread_name,
uint32_t  client_id 
)

Definition at line 14 of file thread.c.

15 {
16 if (!thread || !func || !thread_name) {
17 return SET_ERRNO(ERROR_INVALID_PARAM, "Invalid parameters for thread creation");
18 }
19
20 int result = asciichat_thread_create(thread, func, arg);
21 if (result != 0) {
22 return SET_ERRNO(ERROR_PLATFORM_INIT, "Failed to create %s thread for client %u (result=%d)", thread_name,
23 client_id, result);
24 }
25
26 log_debug("Created %s thread for client %u successfully", thread_name, client_id);
27 return ASCIICHAT_OK;
28}
int asciichat_thread_create(asciichat_thread_t *thread, void *(*start_routine)(void *), void *arg)
Definition threading.c:42

References asciichat_thread_create().