Provide an abstract thread pool object
[openafs.git] / src / util / thread_pool_types.h
1 /*
2  * Copyright 2008-2010, Sine Nomine Associates and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef AFS_UTIL_THREAD_POOL_TYPES_H
11 #define AFS_UTIL_THREAD_POOL_TYPES_H 1
12
13 /**
14  *  public type definitions for thread_pool.
15  */
16
17 /* forward declare opaque types */
18 struct afs_thread_pool_worker;
19 struct afs_thread_pool;
20 struct afs_work_queue;
21
22 /**
23  * thread_pool worker thread entry function.
24  *
25  * @param[in] pool    thread pool object pointer
26  * @param[in] worker  worker thread object pointer
27  * @param[in] queue   work queue object pointer
28  * @param[in] rock    opaque pointer
29  *
30  * @return opaque pointer
31  */
32 typedef void * afs_tp_worker_func_t(struct afs_thread_pool * pool,
33                                     struct afs_thread_pool_worker * worker,
34                                     struct afs_work_queue * queue,
35                                     void * rock);
36
37 #endif /* AFS_UTIL_THREAD_POOL_TYPES_H */