Skip to content

Detached non-Send tasks don't run #6120

@Suficio

Description

@Suficio

Detached task on local thread is not run after:
#4466

Bevy version

First commit to be affected:
d22d310

Relevant system information

  • cargo 1.64.0 (387270bc7 2022-09-16)
  • Windows 11

What you did

use bevy::{prelude::*, tasks::ComputeTaskPool};

fn main() {
    App::new()
        .add_plugins(MinimalPlugins)
        .add_startup_system(startup)
        .run();
}

fn startup() {
    ComputeTaskPool::get()
        .spawn_local(async { println!("hi") })
        .detach();
}

What went wrong

hi is not printed :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TasksTools for parallel and async workC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions