Skip to content

Fallback to the global allocator when the TLS var has been deinitialized. #154

Closed
@ticki

Description

@ticki

Currently you (sometimes) get a panick if you use rand::random() in a TLS dtor. This is because the RNG state TLS var can have been deinitialized and thus unavailable. Ideally, rand should check if the TLS var is available (https://doc.rust-lang.org/nightly/std/thread/struct.LocalKey.html#method.state), and if not, fallback to the global RNG state.

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