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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to