ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1
50
51#pragma once
52
53#include <string.h>
54#include <libplatform/thread.h>
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
66#define THREAD_IS_CREATED(created_flag) ((created_flag) == true)
67
80#define THREAD_CREATE_SAFE(thread_var, func, arg) platform_thread_create(&(thread_var), (func), (arg))
81
101#define THREAD_CREATE_OR_RETURN_VOID(thread_var, func, arg, error_msg) \
102 do { \
103 if (platform_thread_create(&(thread_var), (func), (arg)) != 0) { \
104 log_error("%s", (error_msg)); \
105 return; \
106 } \
107 } while (0)
108
123#define THREAD_JOIN_SAFE(thread_var, exit_code) thread_join(&(thread_var), (exit_code))
124
136#define THREAD_JOIN(thread_var) thread_join(&(thread_var), NULL)
137
149#define THREAD_CLEAR_HANDLE(thread_var) memset(&(thread_var), 0, sizeof(thread_var))
150
151#ifdef __cplusplus
152}
153#endif
🔤 String Manipulation and Shell Escaping Utilities