Merge remote-tracking branch 'rth/tags/pull-s390-20170512' into staging
[qemu/ar7.git] / include / sysemu / iothread.h
blobe6da1a408784efb6bd36acf45fba3900abaa4d2e
1 /*
2 * Event loop thread
4 * Copyright Red Hat Inc., 2013
6 * Authors:
7 * Stefan Hajnoczi <stefanha@redhat.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
14 #ifndef IOTHREAD_H
15 #define IOTHREAD_H
17 #include "block/aio.h"
18 #include "qemu/thread.h"
20 #define TYPE_IOTHREAD "iothread"
22 typedef struct {
23 Object parent_obj;
25 QemuThread thread;
26 AioContext *ctx;
27 QemuMutex init_done_lock;
28 QemuCond init_done_cond; /* is thread initialization done? */
29 bool stopping;
30 int thread_id;
32 /* AioContext poll parameters */
33 int64_t poll_max_ns;
34 int64_t poll_grow;
35 int64_t poll_shrink;
36 } IOThread;
38 #define IOTHREAD(obj) \
39 OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD)
41 char *iothread_get_id(IOThread *iothread);
42 AioContext *iothread_get_aio_context(IOThread *iothread);
43 void iothread_stop_all(void);
45 #endif /* IOTHREAD_H */