[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxl: event handling: Break out ao_work_outstanding



commit 93699882d98cce9736d6e871db303275df1138a2
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Mon Feb 9 15:18:30 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Feb 9 17:41:30 2015 +0000

    libxl: event handling: Break out ao_work_outstanding
    
    Break out the test in libxl__ao_complete_check_progress_reports, into
    ao_work_outstanding, which reports false if either (i) the ao is still
    ongoing or (ii) there is a progress report (perhaps on a different
    thread's callback queue) which has yet to be reported to the
    application.
    
    No functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
    CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
    CC: Wei Liu <wei.liu2@xxxxxxxxxx>
    CC: Jim Fehlig <jfehlig@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl_event.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index ae73728..89ca6d2 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1773,19 +1773,25 @@ void libxl__ao_complete(libxl__egc *egc, libxl__ao *ao, 
int rc)
     libxl__ao_complete_check_progress_reports(egc, ao);
 }
 
-void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
+static bool ao_work_outstanding(libxl__ao *ao)
 {
     /*
      * We don't consider an ao complete if it has any outstanding
      * callbacks.  These callbacks might be outstanding on other
      * threads, queued up in the other threads' egc's.  Those threads
      * will, after making the callback, take out the lock again,
-     * decrement progress_reports_outstanding, and call us again.
+     * decrement progress_reports_outstanding, and call
+     * libxl__ao_complete_check_progress_reports.
      */
+    return !ao->complete || ao->progress_reports_outstanding;
+}
+
+void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
+{
     libxl_ctx *ctx = libxl__gc_owner(&egc->gc);
     assert(ao->progress_reports_outstanding >= 0);
 
-    if (!ao->complete || ao->progress_reports_outstanding)
+    if (ao_work_outstanding(ao))
         return;
 
     if (ao->poller) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.