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

Re: [Xen-devel] [PATCH 3/3] libxl: event system: properly register the SIGCHLD self-pipe

On Tue, 2013-11-05 at 19:19 +0000, Ian Jackson wrote:
> An application which uses libxl_osevent_register_hooks, and doesn't
> use libxl_sigchld_owner_mainloop, would never properly experience the
> deaths of its (libxl) children.
> This is because the SIGCHLD self pipe would be handled using ad-hoc
> code in beforepoll_internal and afterpoll_internal.  However, this is
> no good if application is using the fd registration system instead; in
> that case these functions would not be called and nothing would deal
> with readability of the self pipe.
> Fix this as follows:
> The SIGCHLD self pipe now is now dealt with by a standard libxl__ev_fd
> handler, which is registered and deregistered along with the SIGCHLD
> handler itself.  The handler function subsumes the ad-hoc response
> code removed from beforepoll_internal, and the functionality of
> libxl__fork_selfpipe_woken.
> This is also tidier as the SIGCHLD self pipe is no longer touched
> outside libxl_fork.c other than in ctx initialisation and teardown.
> (The ad-hoc arrangements for poller->wakeup_pipe in
> beforepoll_internal and afterpoll_internal are OK because the
> libxl__poller mechanism exists to wake up threads which are sitting
> inside libxl's poll loop, so is not applicable to the application's
> event loop.)
> Reported-by: Bamvor Jian Zhang <bjzhang@xxxxxxxx>
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> Cc: Bamvor Jian Zhang <bjzhang@xxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Xen-devel mailing list



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