/******************************************************************************/ /* SlunkCrypt, by LoRd_MuldeR */ /* This work has been released under the CC0 1.0 Universal license! */ /******************************************************************************/ #ifndef INC_SLUNKCRYPT_THREAD_H #define INC_SLUNKCRYPT_THREAD_H #include #include #define MAX_THREADS 16U #define THRDPL_NULL ((thrdpl_t)NULL) typedef void (*thrdpl_worker_t)(const size_t thread_count, void *const context, uint8_t *const buffer, const size_t length); typedef uintptr_t thrdpl_t; thrdpl_t slunkcrypt_thrdpl_create(const size_t count); size_t slunkcrypt_thrdpl_count(const thrdpl_t thrdpl); void slunkcrypt_thrdpl_exec(const thrdpl_t thrdpl, const size_t index, const thrdpl_worker_t worker, void *const context, uint8_t *const buffer, const size_t length); void slunkcrypt_thrdpl_await(const thrdpl_t thrdpl); void slunkcrypt_thrdpl_destroy(const thrdpl_t thrdpl); #endif