Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / include / block / thread-pool.h
blob95ff2b0bdbabdab28559e4cb329855eee17d156d
1 /*
2 * QEMU block layer thread pool
4 * Copyright IBM, Corp. 2008
5 * Copyright Red Hat, Inc. 2012
7 * Authors:
8 * Anthony Liguori <aliguori@us.ibm.com>
9 * Paolo Bonzini <pbonzini@redhat.com>
11 * This work is licensed under the terms of the GNU GPL, version 2. See
12 * the COPYING file in the top-level directory.
14 * Contributions after 2012-01-13 are licensed under the terms of the
15 * GNU GPL, version 2 or (at your option) any later version.
18 #ifndef QEMU_THREAD_POOL_H
19 #define QEMU_THREAD_POOL_H
21 #include "block/aio.h"
23 #define THREAD_POOL_MAX_THREADS_DEFAULT 64
25 typedef int ThreadPoolFunc(void *opaque);
27 typedef struct ThreadPool ThreadPool;
29 ThreadPool *thread_pool_new(struct AioContext *ctx);
30 void thread_pool_free(ThreadPool *pool);
32 BlockAIOCB *thread_pool_submit_aio(ThreadPool *pool,
33 ThreadPoolFunc *func, void *arg,
34 BlockCompletionFunc *cb, void *opaque);
35 int coroutine_fn thread_pool_submit_co(ThreadPool *pool,
36 ThreadPoolFunc *func, void *arg);
37 void thread_pool_submit(ThreadPool *pool, ThreadPoolFunc *func, void *arg);
38 void thread_pool_update_params(ThreadPool *pool, struct AioContext *ctx);
40 #endif