backport to buster
[hcoop/debian/openafs.git] / src / util / thread_pool.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_H
11 #define AFS_UTIL_THREAD_POOL_H 1
12
13 #include "thread_pool_types.h"
14
15 /**
16 * public interfaces for thread_pool.
17 */
18
19 /* XXX move these into an et */
20 #define AFS_TP_ERROR -1 /**< fatal error in thread_pool package */
21
22 extern int afs_tp_create(struct afs_thread_pool **,
23 struct afs_work_queue *);
24 extern int afs_tp_destroy(struct afs_thread_pool *);
25
26 extern int afs_tp_set_threads(struct afs_thread_pool *, afs_uint32 threads);
27 extern int afs_tp_set_entry(struct afs_thread_pool *,
28 afs_tp_worker_func_t *,
29 void * rock);
30
31 extern int afs_tp_start(struct afs_thread_pool *);
32 extern int afs_tp_shutdown(struct afs_thread_pool *,
33 int block);
34
35 extern int afs_tp_is_online(struct afs_thread_pool *);
36 extern int afs_tp_worker_continue(struct afs_thread_pool_worker *);
37
38 #endif /* AFS_UTIL_THREAD_POOL_H */