]>
Commit | Line | Data |
---|---|---|
be8d8537 SH |
1 | /* |
2 | * Event loop thread | |
3 | * | |
4 | * Copyright Red Hat Inc., 2013 | |
5 | * | |
6 | * Authors: | |
7 | * Stefan Hajnoczi <stefanha@redhat.com> | |
8 | * | |
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. | |
11 | * | |
12 | */ | |
13 | ||
14 | #ifndef IOTHREAD_H | |
15 | #define IOTHREAD_H | |
16 | ||
17 | #include "block/aio.h" | |
8c2664d8 | 18 | #include "qemu/thread.h" |
be8d8537 SH |
19 | |
20 | #define TYPE_IOTHREAD "iothread" | |
21 | ||
8c2664d8 SH |
22 | typedef struct { |
23 | Object parent_obj; | |
24 | ||
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; | |
0d9d86fb SH |
31 | |
32 | /* AioContext poll parameters */ | |
33 | int64_t poll_max_ns; | |
8c2664d8 | 34 | } IOThread; |
be8d8537 SH |
35 | |
36 | #define IOTHREAD(obj) \ | |
37 | OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD) | |
38 | ||
be8d8537 SH |
39 | char *iothread_get_id(IOThread *iothread); |
40 | AioContext *iothread_get_aio_context(IOThread *iothread); | |
dce8921b | 41 | void iothread_stop_all(void); |
be8d8537 SH |
42 | |
43 | #endif /* IOTHREAD_H */ |