summaryrefslogtreecommitdiff
path: root/thread_pool.h
diff options
context:
space:
mode:
Diffstat (limited to 'thread_pool.h')
-rw-r--r--thread_pool.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/thread_pool.h b/thread_pool.h
index 496fd9c..9954846 100644
--- a/thread_pool.h
+++ b/thread_pool.h
@@ -15,14 +15,15 @@
* along with toolbox. If not, see <https://www.gnu.org/licenses/>.
*/
-#ifndef THREAD_POOL_H_
-#define THREAD_POOL_H_
+#ifndef TOOLBOX_THREAD_POOL_H_
+#define TOOLBOX_THREAD_POOL_H_
#include <stdatomic.h>
+#include <stdbool.h>
#include <stddef.h>
#include <threads.h>
-struct ThreadPool_Task;
+struct ThreadPoolTask;
struct ThreadPool {
atomic_bool running;
@@ -30,13 +31,13 @@ struct ThreadPool {
size_t threads_count;
cnd_t tasks_cond;
mtx_t tasks_mutex;
- struct ThreadPool_Task* tasks;
+ struct ThreadPoolTask* tasks;
size_t tasks_count;
};
-int ThreadPool_Create(struct ThreadPool* thread_pool, size_t threads_count);
-int ThreadPool_Schedule(struct ThreadPool* thread_pool, void (*fun)(void*),
+bool ThreadPoolCreate(struct ThreadPool* thread_pool, size_t threads_count);
+bool ThreadPoolSchedule(struct ThreadPool* thread_pool, void (*fun)(void*),
void* user);
-void ThreadPool_Destroy(struct ThreadPool* thread_pool);
+void ThreadPoolDestroy(struct ThreadPool* thread_pool);
-#endif // THREAD_POOL_H_
+#endif // TOOLBOX_THREAD_POOL_H_