]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
mainloop: add comments about multishot and oneshot cleanup
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 11 Aug 2021 14:54:34 +0000 (16:54 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 11 Aug 2021 15:47:39 +0000 (17:47 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/mainloop.c

index 8371cc0660934ba7efceb7c72bfad9084967014c..473946de8b1be4a1d9a85796f8d4f2d4de530a80 100644 (file)
@@ -292,7 +292,17 @@ static int __lxc_mainloop_io_uring(struct lxc_async_descr *descr, int timeout_ms
                                        return -1;
                                break;
                        case LXC_MAINLOOP_DISARM:
+                               /*
+                                * If this is a multhishot handler we need to
+                                * disarm it here. Actual cleanup happens
+                                * later.
+                                */
                                disarm_handler(descr, handler, oneshot);
+                               /*
+                                * If this is a oneshot handler we know it has
+                                * just run and we also know the above call was
+                                * a nop. So clean it up directly.
+                                */
                                if (oneshot)
                                        delete_handler(handler);
                                break;