aio-wait.c (c5e4e49258e9b89cb34c085a419dd9f862935c48) aio-wait.c (d73415a315471ac0b127ed3fad45c8ec5d711de1)
1/*
2 * AioContext wait support
3 *
4 * Copyright (C) 2018 Red Hat, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 22 unchanged lines hidden (view full) ---

31static void dummy_bh_cb(void *opaque)
32{
33 /* The point is to make AIO_WAIT_WHILE()'s aio_poll() return */
34}
35
36void aio_wait_kick(void)
37{
38 /* The barrier (or an atomic op) is in the caller. */
1/*
2 * AioContext wait support
3 *
4 * Copyright (C) 2018 Red Hat, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 22 unchanged lines hidden (view full) ---

31static void dummy_bh_cb(void *opaque)
32{
33 /* The point is to make AIO_WAIT_WHILE()'s aio_poll() return */
34}
35
36void aio_wait_kick(void)
37{
38 /* The barrier (or an atomic op) is in the caller. */
39 if (atomic_read(&global_aio_wait.num_waiters)) {
39 if (qatomic_read(&global_aio_wait.num_waiters)) {
40 aio_bh_schedule_oneshot(qemu_get_aio_context(), dummy_bh_cb, NULL);
41 }
42}
43
44typedef struct {
45 bool done;
46 QEMUBHFunc *cb;
47 void *opaque;

--- 25 unchanged lines hidden ---
40 aio_bh_schedule_oneshot(qemu_get_aio_context(), dummy_bh_cb, NULL);
41 }
42}
43
44typedef struct {
45 bool done;
46 QEMUBHFunc *cb;
47 void *opaque;

--- 25 unchanged lines hidden ---