From: Christian Brauner Date: Wed, 11 Aug 2021 14:54:34 +0000 (+0200) Subject: mainloop: add comments about multishot and oneshot cleanup X-Git-Tag: lxc-5.0.0~114^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9d1f58725667774b07ac6a0084838c3da1d6314;p=thirdparty%2Flxc.git mainloop: add comments about multishot and oneshot cleanup Signed-off-by: Christian Brauner --- diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c index 8371cc066..473946de8 100644 --- a/src/lxc/mainloop.c +++ b/src/lxc/mainloop.c @@ -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;