1 /*****************************************************************************
2 * threadpool.h: thread pooling
3 *****************************************************************************
4 * Copyright (C) 2010-2016 x264 project
6 * Authors: Steven Walters <kemuri9@gmail.com>
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.
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.
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.
22 * This program is also available under a commercial proprietary license.
23 * For more information, contact us at licensing@x264.com.
24 *****************************************************************************/
26 #ifndef X264_THREADPOOL_H
27 #define X264_THREADPOOL_H
29 typedef struct x264_threadpool_t x264_threadpool_t;
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 );
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)