static void event_notifier_ready(EventNotifier *notifier)

{

    ThreadPool *pool = container_of(notifier, ThreadPool, notifier);

    ThreadPoolElement *elem, *next;



    event_notifier_test_and_clear(notifier);

restart:

    QLIST_FOREACH_SAFE(elem, &pool->head, all, next) {

        if (elem->state != THREAD_CANCELED && elem->state != THREAD_DONE) {

            continue;

        }

        if (elem->state == THREAD_DONE) {

            trace_thread_pool_complete(pool, elem, elem->common.opaque,

                                       elem->ret);

        }

        if (elem->state == THREAD_DONE && elem->common.cb) {

            QLIST_REMOVE(elem, all);

            /* Read state before ret.  */

            smp_rmb();

            elem->common.cb(elem->common.opaque, elem->ret);

            qemu_aio_release(elem);

            goto restart;

        } else {

            /* remove the request */

            QLIST_REMOVE(elem, all);

            qemu_aio_release(elem);

        }

    }

}

static void event_notifier_ready(EventNotifier *notifier)

{

    ThreadPool *pool = container_of(notifier, ThreadPool, notifier);

    ThreadPoolElement *elem, *next;



    event_notifier_test_and_clear(notifier);

restart:

    QLIST_FOREACH_SAFE(elem, &pool->head, all, next) {

        if (elem->state != THREAD_CANCELED && elem->state != THREAD_DONE) {

            continue;

        }

        if (elem->state == THREAD_DONE) {

            trace_thread_pool_complete(pool, elem, elem->common.opaque,

                                       elem->ret);

        }

        if (elem->state == THREAD_DONE && elem->common.cb) {

            QLIST_REMOVE(elem, all);

            

            smp_rmb();

            elem->common.cb(elem->common.opaque, elem->ret);

            qemu_aio_release(elem);

            goto restart;

        } else {

            

            QLIST_REMOVE(elem, all);

            qemu_aio_release(elem);

        }

    }

}

static void FUNC_0(EventNotifier *VAR_0)

{

    ThreadPool *pool = container_of(VAR_0, ThreadPool, VAR_0);

    ThreadPoolElement *elem, *next;



    event_notifier_test_and_clear(VAR_0);

restart:

    QLIST_FOREACH_SAFE(elem, &pool->head, all, next) {

        if (elem->state != THREAD_CANCELED && elem->state != THREAD_DONE) {

            continue;

        }

        if (elem->state == THREAD_DONE) {

            trace_thread_pool_complete(pool, elem, elem->common.opaque,

                                       elem->ret);

        }

        if (elem->state == THREAD_DONE && elem->common.cb) {

            QLIST_REMOVE(elem, all);

            

            smp_rmb();

            elem->common.cb(elem->common.opaque, elem->ret);

            qemu_aio_release(elem);

            goto restart;

        } else {

            

            QLIST_REMOVE(elem, all);

            qemu_aio_release(elem);

        }

    }

}

static void FUNC_0(EventNotifier *VAR_0)
{ ThreadPool *pool = container_of(VAR_0, ThreadPool, VAR_0); ThreadPoolElement *elem, *next; event_notifier_test_and_clear(VAR_0); restart:
QLIST_FOREACH_SAFE(elem, &pool->head, all, next) { if (elem->state != THREAD_CANCELED && elem->state != THREAD_DONE) { continue; } if (elem->state == THREAD_DONE) { trace_thread_pool_complete(pool, elem, elem->common.opaque,
elem->ret); } if (elem->state == THREAD_DONE && elem->common.cb) { QLIST_REMOVE(elem, all); smp_rmb(); elem->common.cb(elem->common.opaque, elem->ret); qemu_aio_release(elem); goto restart; } else { QLIST_REMOVE(elem, all); qemu_aio_release(elem); } } }