• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * libiio - Library for interfacing industrial I/O (IIO) devices
3  *
4  * Copyright (C) 2016 Analog Devices, Inc.
5  * Author: Paul Cercueil <paul.cercueil@analog.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  */
17 
18 #ifndef __THREAD_POOL_H__
19 #define __THREAD_POOL_H__
20 
21 struct thread_pool;
22 
23 struct thread_pool * thread_pool_new(void);
24 
25 int thread_pool_get_poll_fd(const struct thread_pool *pool);
26 void thread_pool_stop(struct thread_pool *pool);
27 void thread_pool_stop_and_wait(struct thread_pool *pool);
28 
29 void thread_pool_destroy(struct thread_pool *pool);
30 
31 int thread_pool_add_thread(struct thread_pool *pool,
32 		void (*func)(struct thread_pool *, void *),
33 		void *data, const char *name);
34 
35 #endif /* __THREAD_POOL_H__ */
36