mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 05:03:46 +08:00
Revert "Improved blocked prcoess comments, clarified job vs command chain"
This reverts commit dfac81803b
.
It was meant for the major branch.
This commit is contained in:
parent
8ebba2066d
commit
e0ccb8c48e
10
src/exec.cpp
10
src/exec.cpp
|
@ -1064,13 +1064,13 @@ void exec_job(parser_t &parser, job_t *j) {
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
// This is the child process.
|
// This is the child process.
|
||||||
p->pid = getpid();
|
p->pid = getpid();
|
||||||
|
// the process will be resumed by the shell when the next command in the
|
||||||
|
// chain is started
|
||||||
setup_child_process(j, p, process_net_io_chain);
|
setup_child_process(j, p, process_net_io_chain);
|
||||||
|
|
||||||
// Start child processes that are part of a chain in a stopped state
|
// start child processes that are part of a job in a stopped state
|
||||||
// to ensure that they are still running when the next command in the
|
// to ensure that they are still running when the next command in the
|
||||||
// chain is started.
|
// chain is started.
|
||||||
// The process will be resumed when the next command in the chain is started.
|
|
||||||
// Note that this may span multiple jobs, as jobs can read from each other.
|
|
||||||
if (pipes_to_next_command) {
|
if (pipes_to_next_command) {
|
||||||
kill(p->pid, SIGSTOP);
|
kill(p->pid, SIGSTOP);
|
||||||
}
|
}
|
||||||
|
@ -1081,7 +1081,7 @@ void exec_job(parser_t &parser, job_t *j) {
|
||||||
} else {
|
} else {
|
||||||
if (pipes_to_next_command) {
|
if (pipes_to_next_command) {
|
||||||
//it actually blocked itself after forking above, but print in here for output
|
//it actually blocked itself after forking above, but print in here for output
|
||||||
//synchronization & so we can assign command_blocked in the correct address space
|
//synchronization and so we can assign blocked_pid in the correct address space
|
||||||
debug(2, L"Blocking process %d waiting for next command in chain.\n", pid);
|
debug(2, L"Blocking process %d waiting for next command in chain.\n", pid);
|
||||||
command_blocked = true;
|
command_blocked = true;
|
||||||
}
|
}
|
||||||
|
@ -1115,8 +1115,6 @@ void exec_job(parser_t &parser, job_t *j) {
|
||||||
blocked_pid = -1;
|
blocked_pid = -1;
|
||||||
}
|
}
|
||||||
if (command_blocked) {
|
if (command_blocked) {
|
||||||
//store the newly-blocked command's PID so that it can be SIGCONT'd once the next process
|
|
||||||
//in the chain is started. That may be in this job or in another job.
|
|
||||||
blocked_pid = p->pid;
|
blocked_pid = p->pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user