[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] qemu-iothread: IOThread supports the GMainCo
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2] qemu-iothread: IOThread supports the GMainContext event loop |
Date: |
Wed, 16 Aug 2017 13:30:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 16/08/2017 11:52, Stefan Hajnoczi wrote:
>
> while (!atomic_read(&iothread->stopping)) {
> if (atomic_read(&iothread->use_glib_event_loop)) {
> iothread_glib_event_loop();
> break;
> }
>
> aio_poll(iothread->ctx, true);
> }
Alternatively:
while (!atomic_read(&iothread->stopping)) {
aio_poll(iothread->ctx, true);
}
if (atomic_read(&iothread->worker_context)) {
iothread_glib_event_loop();
}
and you can use this to enter the glib event loop:
iothread->stopping = true;
aio_notify(iothread->ctx);
(similar to iothread_stop).
Thanks,
Paolo
signature.asc
Description: OpenPGP digital signature