SW#
All Files Functions Variables Typedefs Macros
threadpool.h
Go to the documentation of this file.
1 /*
2 swsharp - CUDA parallelized Smith Waterman with applying Hirschberg's and
3 Ukkonen's algorithm and dynamic cell pruning.
4 Copyright (C) 2013 Matija Korpar, contributor Mile Šikić
5 
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 Contact the author by mkorpar@gmail.com.
20 */
27 #ifndef __SW_SHARP_THREAD_POOLH__
28 #define __SW_SHARP_THREAD_POOLH__
29 
30 #include "thread.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct ThreadPoolTask ThreadPoolTask;
37 
38 extern int threadPoolInitialize(int n);
39 
40 extern void threadPoolTerminate();
41 
42 extern ThreadPoolTask* threadPoolSubmit(void* (*routine)(void*), void* param);
43 
44 extern ThreadPoolTask* threadPoolSubmitToFront(void* (*routine)(void*), void* param);
45 
46 extern void threadPoolTaskDelete(ThreadPoolTask* task);
47 
48 extern void threadPoolTaskWait(ThreadPoolTask* task);
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 #endif // __SW_SHARP_THREAD_POOLH__
Multiplatform threading header.