]> git.proxmox.com Git - mirror_qemu.git/blame - include/block/thread-pool.h
nbd: Use enum for various negotiation modes
[mirror_qemu.git] / include / block / thread-pool.h
CommitLineData
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 <aliguori@us.ibm.com>
9 * Paolo Bonzini <pbonzini@redhat.com>
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
e2c1c34f 21#include "block/aio.h"
d354c7ec 22
71ad4713
NSJ
23#define THREAD_POOL_MAX_THREADS_DEFAULT 64
24
d354c7ec
PB
25typedef int ThreadPoolFunc(void *opaque);
26
f7311ccc
SH
27typedef struct ThreadPool ThreadPool;
28
29ThreadPool *thread_pool_new(struct AioContext *ctx);
30void thread_pool_free(ThreadPool *pool);
31
0fdb7311
EGE
32/*
33 * thread_pool_submit* API: submit I/O requests in the thread's
34 * current AioContext.
35 */
aef04fc7
EGE
36BlockAIOCB *thread_pool_submit_aio(ThreadPoolFunc *func, void *arg,
37 BlockCompletionFunc *cb, void *opaque);
38int coroutine_fn thread_pool_submit_co(ThreadPoolFunc *func, void *arg);
39void thread_pool_submit(ThreadPoolFunc *func, void *arg);
0fdb7311 40
71ad4713 41void thread_pool_update_params(ThreadPool *pool, struct AioContext *ctx);
d354c7ec
PB
42
43#endif