We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c431dac commit d27f157Copy full SHA for d27f157
os/src/task/mod.rs
@@ -127,6 +127,13 @@ pub fn exit_current_and_run_next(exit_code: i32) {
127
process_inner.memory_set.recycle_data_pages();
128
// drop file descriptors
129
process_inner.fd_table.clear();
130
+ // Remove all tasks except for the main thread itself.
131
+ // This is because we are still using the kstack under the TCB
132
+ // of the main thread. This TCB, including its kstack, will be
133
+ // deallocated when the process is reaped via waitpid.
134
+ while process_inner.tasks.len() > 1 {
135
+ process_inner.tasks.pop();
136
+ }
137
}
138
drop(process);
139
// we do not have to save task context
0 commit comments