From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMdKw-0002mN-J4 for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMdKp-0002iR-IC for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:48 -0500 Received: from [199.232.76.173] (port=52819 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMdKo-0002i8-So for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9183) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMdKo-0003oe-AU for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:42 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBL89fre020491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Dec 2009 03:09:41 -0500 Received: from localhost.localdomain (vpn2-10-119.ams2.redhat.com [10.36.10.119]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBL89V3U011460 for ; Mon, 21 Dec 2009 03:09:41 -0500 From: Paolo Bonzini Date: Mon, 21 Dec 2009 09:09:21 +0100 Message-Id: <1261382970-23251-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1261382970-23251-1-git-send-email-pbonzini@redhat.com> References: <1261382970-23251-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 10/19] add qemu_bh_scheduled List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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); -- 1.6.5.2