mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 16:13:27 +00:00
Drop the strong reference of Task before exiting
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
f8bd71a1e7
commit
cff688e128
@ -183,7 +183,7 @@ pub(super) fn run_new_task(runnable: Arc<Task>) {
|
||||
/// Dequeues the current task from its runqueue.
|
||||
///
|
||||
/// This should only be called if the current is to exit.
|
||||
pub(super) fn exit_current() {
|
||||
pub(super) fn exit_current() -> ! {
|
||||
reschedule(&mut |local_rq: &mut dyn LocalRunQueue| {
|
||||
let _ = local_rq.dequeue_current();
|
||||
if let Some(next_task) = local_rq.pick_next_current() {
|
||||
@ -191,7 +191,9 @@ pub(super) fn exit_current() {
|
||||
} else {
|
||||
ReschedAction::Retry
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
/// Yields execution.
|
||||
|
Reference in New Issue
Block a user