Skip to content

Thread name is not set #143

Open
Open
@elwerene

Description

@elwerene

I tried this code:

thread::Builder::new().name("thread1".to_string()).spawn(move || {
    println!("Hello, world!");
});

I expected to see this happen: The thread/freertos task gets names thread1

Instead, this happened: The thread/freertos task gets names pthread

My guess of a reason

There's not set_name implemented for espidf:

https://github.com/esp-rs/rust/blob/esp-1.64.0.0/library/std/src/sys/unix/thread.rs#L205

So the pthread name is not set and it defaults to pthread:

https://github.com/espressif/esp-idf/blob/master/components/pthread/pthread.c#L237

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions