From patchwork Mon Dec 21 08:09:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [10/19] add qemu_bh_scheduled Date: Sun, 20 Dec 2009 22:09:21 -0000 From: Paolo Bonzini X-Patchwork-Id: 41529 Message-Id: <1261382970-23251-11-git-send-email-pbonzini@redhat.com> To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- async.c | 5 +++++ qemu-common.h | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/async.c b/async.c index 57ac3a8..d58a1d5 100644 --- a/async.c +++ b/async.c @@ -188,6 +188,11 @@ void qemu_bh_cancel(QEMUBH *bh) bh->scheduled = 0; } +bool qemu_bh_scheduled(QEMUBH *bh) +{ + return bh->scheduled && !bh->deleted; +} + void qemu_bh_delete(QEMUBH *bh) { bh->scheduled = 0; diff --git a/qemu-common.h b/qemu-common.h index 8630f8c..fac6a18 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -16,6 +16,7 @@ /* we put basic includes here to avoid repeating them in device drivers */ #include +#include #include #include #include @@ -106,6 +107,7 @@ void qemu_bh_schedule(QEMUBH *bh); * iteration. */ void qemu_bh_schedule_idle(QEMUBH *bh); +bool qemu_bh_scheduled(QEMUBH *bh); void qemu_bh_cancel(QEMUBH *bh); void qemu_bh_delete(QEMUBH *bh); int qemu_bh_poll(void);