]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: event: Break out baton_wake
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 10 Jan 2020 13:11:07 +0000 (13:11 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 27 Jan 2020 16:03:17 +0000 (16:03 +0000)
No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Tested-by: George Dunlap <george.dunlap@citrix.com>
---
v2: Now it takes a gc, not an egc.

tools/libxl/libxl_event.c

index 3e76fa5af5c7ce4a8152f5dafb9992a65f48a1cd..45cc67942da43f20e708c437fc2bffb6c152edf0 100644 (file)
@@ -140,6 +140,18 @@ static void pollers_note_osevent_added(libxl_ctx *ctx) {
         poller->osevents_added = 1;
 }
 
+static void baton_wake(libxl__gc *gc, libxl__poller *wake)
+{
+    libxl__poller_wakeup(gc, wake);
+
+    wake->osevents_added = 0;
+    /* This serves to make _1_baton idempotent.  It is OK even though
+     * that poller may currently be sleeping on only old osevents,
+     * because it is going to wake up because we've just prodded it,
+     * and it pick up new osevents on its next iteration (or pass
+     * on the baton). */
+}
+
 void libxl__egc_ao_cleanup_1_baton(libxl__gc *gc)
     /* Any poller we had must have been `put' already. */
 {
@@ -160,14 +172,7 @@ void libxl__egc_ao_cleanup_1_baton(libxl__gc *gc)
         /* no-one in libxl waiting for any events */
         return;
 
-    libxl__poller_wakeup(gc, wake);
-
-    wake->osevents_added = 0;
-    /* This serves to make _1_baton idempotent.  It is OK even though
-     * that poller may currently be sleeping on only old osevents,
-     * because it is going to wake up because we've just prodded it,
-     * and it pick up new osevents on its next iteration (or pass
-     * on the baton). */
+    baton_wake(gc, wake);
 }
 
 /*