Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b8a4538 authored by Yun-hao Chung's avatar Yun-hao Chung Committed by Gerrit Code Review
Browse files

Merge "Floss: Explicitly use topstack runtime to spawn cleanup tasks" into main

parents 365e5b3d 6429a73a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ extern "C" fn handle_sigterm(_signum: i32) {
    if let Some((tx, notifier)) = guard.as_ref() {
        log::debug!("Handling SIGTERM by disabling the adapter!");
        let txl = tx.clone();
        tokio::spawn(async move {
        topstack::get_runtime().spawn(async move {
            // Send the shutdown message here.
            let _ = txl.send(Message::InterfaceShutdown).await;
        });
@@ -295,7 +295,7 @@ extern "C" fn handle_sigterm(_signum: i32) {

        log::debug!("SIGTERM cleaning up the stack.");
        let txl = tx.clone();
        tokio::spawn(async move {
        topstack::get_runtime().spawn(async move {
            // Clean up the profiles first as some of them might require main thread to clean up.
            let _ = txl.send(Message::CleanupProfiles).await;
            // Currently there is no good way to know when the profile is cleaned.