这是indexloc提供的服务,不要输入任何密码
Skip to content

Issue using RefCell with nested rayon threads #1253

@jdmarsh

Description

@jdmarsh

Hello, I am getting an "already borrowed" error when using nested rayon threads and a RefCell object. I have a repro here

What I don't understand is why the creation of a new independent thread pool, with threads that don't access the RefCell in any way, they just do a println, are causing an extra borrow to even be attempted? Is this a bug or am I missing something when creating this thread pool?

n.b. If I just use a regular thread, instead of a rayon thread, everything works as expected as seen here

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