40#ifndef QSC_THREADPOOL_H
41#define QSC_THREADPOOL_H
46QSC_CPLUSPLUS_ENABLED_START
95#define QSC_THREADPOOL_THREADS_MAX 1024ULL
155QSC_CPLUSPLUS_ENABLED_END
Asynchronous Thread and Mutex Management Functions.
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition common.h:520
#define QSC_SYSTEM_CONDITION_IGNORE(x)
MSVC-specific macro to disable a specific warning condition.
Definition common.h:784
The thread pool state.
Definition threadpool.h:102
qsc_thread tpool[QSC_THREADPOOL_THREADS_MAX]
Definition threadpool.h:103
size_t tcount
Definition threadpool.h:104
QSC_EXPORT_API void qsc_threadpool_initialize(qsc_threadpool_state *ctx)
Initialize the thread-pool.
QSC_EXPORT_API void qsc_threadpool_sort(qsc_threadpool_state *ctx)
Sort the threads in the pool, placing active threads at the start of the array.
QSC_EXPORT_API bool qsc_threadpool_thread_active(const qsc_threadpool_state *ctx, size_t index)
Check if a thread is active.
QSC_EXPORT_API void qsc_threadpool_clear(qsc_threadpool_state *ctx)
Clear all tasks from the thread-pool.
#define QSC_THREADPOOL_THREADS_MAX
The thread pool maximum threads.
Definition threadpool.h:95
QSC_EXPORT_API bool qsc_threadpool_add_task(qsc_threadpool_state *ctx, void(*func)(void *), void *state)
Add a task to the thread-pool.
QSC_EXPORT_API void qsc_threadpool_remove_task(qsc_threadpool_state *ctx, size_t index)
Remove a task from the thread-pool.