Commit 80d3580b29d84221650fd2dc7f26706d50f21197
1 parent
5ccfae10
Clarify qemu_bh_schedule_idle() usage
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5576 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
0 deletions
qemu-common.h
| ... | ... | @@ -70,6 +70,12 @@ typedef void QEMUBHFunc(void *opaque); |
| 70 | 70 | |
| 71 | 71 | QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque); |
| 72 | 72 | void qemu_bh_schedule(QEMUBH *bh); |
| 73 | +/* Bottom halfs that are scheduled from a bottom half handler are instantly | |
| 74 | + * invoked. This can create an infinite loop if a bottom half handler | |
| 75 | + * schedules itself. qemu_bh_schedule_idle() avoids this infinite loop by | |
| 76 | + * ensuring that the bottom half isn't executed until the next main loop | |
| 77 | + * iteration. | |
| 78 | + */ | |
| 73 | 79 | void qemu_bh_schedule_idle(QEMUBH *bh); |
| 74 | 80 | void qemu_bh_cancel(QEMUBH *bh); |
| 75 | 81 | void qemu_bh_delete(QEMUBH *bh); | ... | ... |