1 /*****************************************************************************
2  * threadpool.h: thread pooling
3  *****************************************************************************
4  * Copyright (C) 2010-2014 x264 project
5  *
6  * Authors: Steven Walters <kemuri9@gmail.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
21  *
22  * This program is also available under a commercial proprietary license.
23  * For more information, contact us at licensing@x264.com.
24  *****************************************************************************/
25 
26 #ifndef X264_THREADPOOL_H
27 #define X264_THREADPOOL_H
28 
29 typedef struct x264_threadpool_t x264_threadpool_t;
30 
31 #if HAVE_THREAD
32 int   x264_threadpool_init( x264_threadpool_t **p_pool, int threads,
33                             void (*init_func)(void *), void *init_arg );
34 void  x264_threadpool_run( x264_threadpool_t *pool, void *(*func)(void *), void *arg );
35 void *x264_threadpool_wait( x264_threadpool_t *pool, void *arg );
36 void  x264_threadpool_delete( x264_threadpool_t *pool );
37 #else
38 #define x264_threadpool_init(p,t,f,a) -1
39 #define x264_threadpool_run(p,f,a)
40 #define x264_threadpool_wait(p,a)     NULL
41 #define x264_threadpool_delete(p)
42 #endif
43 
44 #endif
45