]> Git Repo - qemu.git/blobdiff - include/block/aio.h
opengl: add flipping vertex shader
[qemu.git] / include / block / aio.h
index 677b6ffc2596ad6b85a4f35227df4a4d2b2e545d..e9aeeaec94484afe26f5b9d35c014ff7d117e710 100644 (file)
@@ -454,8 +454,14 @@ static inline void aio_disable_external(AioContext *ctx)
  */
 static inline void aio_enable_external(AioContext *ctx)
 {
-    assert(ctx->external_disable_cnt > 0);
-    atomic_dec(&ctx->external_disable_cnt);
+    int old;
+
+    old = atomic_fetch_dec(&ctx->external_disable_cnt);
+    assert(old > 0);
+    if (old == 1) {
+        /* Kick event loop so it re-arms file descriptors */
+        aio_notify(ctx);
+    }
 }
 
 /**
@@ -510,6 +516,15 @@ void aio_co_schedule(AioContext *ctx, struct Coroutine *co);
  */
 void aio_co_wake(struct Coroutine *co);
 
+/**
+ * aio_co_enter:
+ * @ctx: the context to run the coroutine
+ * @co: the coroutine to run
+ *
+ * Enter a coroutine in the specified AioContext.
+ */
+void aio_co_enter(AioContext *ctx, struct Coroutine *co);
+
 /**
  * Return the AioContext whose event loop runs in the current thread.
  *
This page took 0.024223 seconds and 4 git commands to generate.