00001 /* $Id: threadpool.h 1182 2008-12-22 22:08:36Z dchassin $ 00002 Copyright (C) 2008 Battelle Memorial Institute 00003 * 00004 * Threadpool types, structures, and operations. 00005 * 00006 * Author: Brandon Carpenter <brandon.carpenter@pnl.gov> 00007 */ 00008 00009 #ifndef _THREADPOOL_H 00010 #define _THREADPOOL_H 00011 00012 #include "list.h" 00013 00014 typedef const void * threadpool_t; 00015 #define INVALID_THREADPOOL ((threadpool_t) NULL) 00016 00017 int processor_count(void); 00018 threadpool_t tp_alloc(int *count, void (*run)(int thread, void *item)); 00019 void tp_exec(threadpool_t pool, LIST *list); 00020 void tp_release(threadpool_t pool); 00021 00022 #endif /* _THREADPOOL_H */ 00023