00001 /* $Id: threadpool.h,v 1.6 2007/06/06 17:11:20 d3p181 Exp $ 00002 * 00003 * Threadpool types, structures, and operations. 00004 * 00005 * Author: Brandon Carpenter <brandon.carpenter@pnl.gov> 00006 */ 00007 00008 #ifndef _THREADPOOL_H 00009 #define _THREADPOOL_H 00010 00011 #include "list.h" 00012 00013 typedef const void * threadpool_t; 00014 #define INVALID_THREADPOOL ((threadpool_t) NULL) 00015 00016 int processor_count(void); 00017 threadpool_t tp_alloc(int *count, void (*run)(int thread, void *item)); 00018 void tp_exec(threadpool_t pool, LIST *list); 00019 void tp_release(threadpool_t pool); 00020 00021 #endif /* _THREADPOOL_H */ 00022