]>
Commit | Line | Data |
---|---|---|
d354c7ec PB |
1 | /* |
2 | * QEMU block layer thread pool | |
3 | * | |
4 | * Copyright IBM, Corp. 2008 | |
5 | * Copyright Red Hat, Inc. 2012 | |
6 | * | |
7 | * Authors: | |
8 | * Anthony Liguori <[email protected]> | |
9 | * Paolo Bonzini <[email protected]> | |
10 | * | |
11 | * This work is licensed under the terms of the GNU GPL, version 2. See | |
12 | * the COPYING file in the top-level directory. | |
13 | * | |
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. | |
16 | */ | |
17 | ||
18 | #ifndef QEMU_THREAD_POOL_H | |
175de524 | 19 | #define QEMU_THREAD_POOL_H |
d354c7ec | 20 | |
a31e69cf | 21 | #include "block/block.h" |
d354c7ec PB |
22 | |
23 | typedef int ThreadPoolFunc(void *opaque); | |
24 | ||
f7311ccc SH |
25 | typedef struct ThreadPool ThreadPool; |
26 | ||
27 | ThreadPool *thread_pool_new(struct AioContext *ctx); | |
28 | void thread_pool_free(ThreadPool *pool); | |
29 | ||
7c84b1b8 | 30 | BlockAIOCB *thread_pool_submit_aio(ThreadPool *pool, |
c4d9d196 | 31 | ThreadPoolFunc *func, void *arg, |
097310b5 | 32 | BlockCompletionFunc *cb, void *opaque); |
c4d9d196 SH |
33 | int coroutine_fn thread_pool_submit_co(ThreadPool *pool, |
34 | ThreadPoolFunc *func, void *arg); | |
35 | void thread_pool_submit(ThreadPool *pool, ThreadPoolFunc *func, void *arg); | |
d354c7ec PB |
36 | |
37 | #endif |