Use "internal" processes to write buffered output

This introduces "internal processes" which are backed by a pthread instead
of a normal process. Internal processes are reaped using the topic
machinery, plugging in neatly alongside the sigchld topic; this means that
process_mark_finished_children() can wait for internal and external
processes simultaneously.

Initially internal processes replace the forked process that fish uses to
write out the output of blocks and functions.
This commit is contained in:
ridiculousfish
2019-02-13 15:17:07 -08:00
parent 061f8f49c6
commit ada8ea954e
7 changed files with 171 additions and 55 deletions

View File

@@ -5106,7 +5106,7 @@ static void test_topic_monitor() {
constexpr auto t = topic_t::sigchld;
do_test(gens[t] == 0);
do_test(monitor.generation_for_topic(t) == 0);
auto changed = monitor.check(&gens, {t}, false /* wait */);
auto changed = monitor.check(&gens, topic_set_t{t}, false /* wait */);
do_test(changed.none());
do_test(gens[t] == 0);