summaryrefslogtreecommitdiff
path: root/iiod/thread-pool.h
diff options
context:
space:
mode:
Diffstat (limited to 'iiod/thread-pool.h')
-rw-r--r--iiod/thread-pool.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/iiod/thread-pool.h b/iiod/thread-pool.h
new file mode 100644
index 0000000..9dbe72a
--- /dev/null
+++ b/iiod/thread-pool.h
@@ -0,0 +1,35 @@
+/*
+ * libiio - Library for interfacing industrial I/O (IIO) devices
+ *
+ * Copyright (C) 2016 Analog Devices, Inc.
+ * Author: Paul Cercueil <paul.cercueil@analog.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ */
+
+#ifndef __THREAD_POOL_H__
+#define __THREAD_POOL_H__
+
+struct thread_pool;
+
+struct thread_pool * thread_pool_new(void);
+
+int thread_pool_get_poll_fd(const struct thread_pool *pool);
+void thread_pool_stop(struct thread_pool *pool);
+void thread_pool_stop_and_wait(struct thread_pool *pool);
+
+void thread_pool_destroy(struct thread_pool *pool);
+
+int thread_pool_add_thread(struct thread_pool *pool,
+ void (*func)(struct thread_pool *, void *),
+ void *data, const char *name);
+
+#endif /* __THREAD_POOL_H__ */