mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-04 06:00:30 +00:00
a23efbb463
We need support three distinct paths for destruction of ncsubprocs: (1) external call to ncsubproc_destroy() while the subprocess is running, (2) external call to ncsubproc_destroy() after the subprocess has terminated, and (3) internal call to ncsubproc_destroy() without any external call. To do this properly, we always waitid() on the subprocess in our ncsubproc thread, and do not cancel said thread. This guarantees that the subprocess has been reaped if the thread has exited. We throw a pidfd_send_signal() into the thread prior to the waitid(), because this is safe with pidfds. The thread reclaims no resources otherwise. ncsubproc_destroy(), instead, reclaims them, after joining the ncsubproc thread. It sends SIGKILL before the join, which is once again safe thanks to pidfds. Resolves #552. |
||
---|---|---|
.. | ||
cell.cpp | ||
channel.cpp | ||
direct.cpp | ||
egcpool.cpp | ||
fade.cpp | ||
fds.cpp | ||
fills.cpp | ||
input.cpp | ||
internal.cpp | ||
main.cpp | ||
main.h | ||
menu.cpp | ||
metric.cpp | ||
ncplane.cpp | ||
notcurses.cpp | ||
palette.cpp | ||
plot.cpp | ||
reel.cpp | ||
resize.cpp | ||
rotate.cpp | ||
scrolling.cpp | ||
selector.cpp | ||
visual.cpp | ||
wide.cpp | ||
zaxis.cpp |