Add a cant_wait parameter to iothread_perform

Sometimes we must spawn a new thread, to avoid the risk of deadlock.
Ensure we always spawn a thread in those cases. In particular this
includes the fillthread.
This commit is contained in:
ridiculousfish
2020-01-18 11:32:44 -08:00
parent d38db1bc61
commit c14d54032f
4 changed files with 18 additions and 9 deletions

View File

@@ -301,7 +301,7 @@ static void run_internal_process(process_t *p, std::string &&outdata, std::strin
// builtin_run provide this directly, rather than setting it in the process.
f->success_status = p->status;
iothread_perform([f]() {
iothread_perform_cantwait([f]() {
proc_status_t status = f->success_status;
if (!f->skip_out()) {
ssize_t ret = write_loop(f->src_outfd, f->outdata.data(), f->outdata.size());