diff --git a/ch8-issue144/os/task/fn.add_initproc.html b/ch8-issue144/os/task/fn.add_initproc.html index 6fae39e6..9b11c235 100644 --- a/ch8-issue144/os/task/fn.add_initproc.html +++ b/ch8-issue144/os/task/fn.add_initproc.html @@ -1,2 +1,2 @@ add_initproc in os::task - Rust -

Function os::task::add_initproc

source ·
pub fn add_initproc()
\ No newline at end of file +

Function os::task::add_initproc

source ·
pub fn add_initproc()
\ No newline at end of file diff --git a/ch8-issue144/os/task/fn.check_signals_of_current.html b/ch8-issue144/os/task/fn.check_signals_of_current.html index 23e5c93f..dc86f1a2 100644 --- a/ch8-issue144/os/task/fn.check_signals_of_current.html +++ b/ch8-issue144/os/task/fn.check_signals_of_current.html @@ -1,2 +1,2 @@ check_signals_of_current in os::task - Rust -
pub fn check_signals_of_current() -> Option<(i32, &'static str)>
\ No newline at end of file +
pub fn check_signals_of_current() -> Option<(i32, &'static str)>
\ No newline at end of file diff --git a/ch8-issue144/os/task/fn.current_add_signal.html b/ch8-issue144/os/task/fn.current_add_signal.html index 52b45319..8d5ebe1e 100644 --- a/ch8-issue144/os/task/fn.current_add_signal.html +++ b/ch8-issue144/os/task/fn.current_add_signal.html @@ -1,2 +1,2 @@ current_add_signal in os::task - Rust -

Function os::task::current_add_signal

source ·
pub fn current_add_signal(signal: SignalFlags)
\ No newline at end of file +

Function os::task::current_add_signal

source ·
pub fn current_add_signal(signal: SignalFlags)
\ No newline at end of file diff --git a/ch8-issue144/os/task/fn.exit_current_and_run_next.html b/ch8-issue144/os/task/fn.exit_current_and_run_next.html index 1b116467..e3580994 100644 --- a/ch8-issue144/os/task/fn.exit_current_and_run_next.html +++ b/ch8-issue144/os/task/fn.exit_current_and_run_next.html @@ -1,3 +1,3 @@ exit_current_and_run_next in os::task - Rust -
pub fn exit_current_and_run_next(exit_code: i32)
Expand description

Exit the current ‘Running’ task and run the next task in task list.

+
pub fn exit_current_and_run_next(exit_code: i32)
Expand description

Exit the current ‘Running’ task and run the next task in task list.

\ No newline at end of file diff --git a/ch8-issue144/os/task/fn.remove_inactive_task.html b/ch8-issue144/os/task/fn.remove_inactive_task.html index f3eabdf8..731da79f 100644 --- a/ch8-issue144/os/task/fn.remove_inactive_task.html +++ b/ch8-issue144/os/task/fn.remove_inactive_task.html @@ -1,2 +1,2 @@ remove_inactive_task in os::task - Rust -

Function os::task::remove_inactive_task

source ·
pub fn remove_inactive_task(task: Arc<TaskControlBlock>)
\ No newline at end of file +

Function os::task::remove_inactive_task

source ·
pub fn remove_inactive_task(task: Arc<TaskControlBlock>)
\ No newline at end of file diff --git a/ch8-issue144/os/task/index.html b/ch8-issue144/os/task/index.html index 9c55ad2b..c9b15f25 100644 --- a/ch8-issue144/os/task/index.html +++ b/ch8-issue144/os/task/index.html @@ -1,2 +1,2 @@ os::task - Rust -

Module os::task

source ·

Re-exports

Modules

Structs

Functions

\ No newline at end of file +

Module os::task

source ·

Re-exports

Modules

Structs

Functions

\ No newline at end of file diff --git a/ch8-issue144/os/task/struct.INITPROC.html b/ch8-issue144/os/task/struct.INITPROC.html index b2284a2c..9a0d053f 100644 --- a/ch8-issue144/os/task/struct.INITPROC.html +++ b/ch8-issue144/os/task/struct.INITPROC.html @@ -1,7 +1,7 @@ INITPROC in os::task - Rust -

Struct os::task::INITPROC

source ·
pub struct INITPROC {
+    

Struct os::task::INITPROC

source ·
pub struct INITPROC {
     __private_field: (),
-}

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for INITPROC

§

type Target = Arc<ProcessControlBlock>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<ProcessControlBlock>

Dereferences the value.
source§

impl LazyStatic for INITPROC

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +}

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for INITPROC

§

type Target = Arc<ProcessControlBlock>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<ProcessControlBlock>

Dereferences the value.
source§

impl LazyStatic for INITPROC

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/ch8-issue144/src/os/task/mod.rs.html b/ch8-issue144/src/os/task/mod.rs.html index ff7d442c..48a02331 100644 --- a/ch8-issue144/src/os/task/mod.rs.html +++ b/ch8-issue144/src/os/task/mod.rs.html @@ -170,6 +170,11 @@ 168 169 170 +171 +172 +173 +174 +175
mod context;
 mod id;
 mod manager;
@@ -303,8 +308,13 @@
         process_inner.memory_set.recycle_data_pages();
         // drop file descriptors
         process_inner.fd_table.clear();
-        // remove all tasks
-        process_inner.tasks.clear();
+        // Remove all tasks except for the main thread itself.
+        // This is because we are still using the kstack under the TCB
+        // of the main thread. This TCB, including its kstack, will be
+        // deallocated when the process is reaped via waitpid.
+        while process_inner.tasks.len() > 1 {
+            process_inner.tasks.pop();
+        }
     }
     drop(process);
     // we do not have to save task context