Skip to content

milliseconds should be represented by u64, not u32 type #28171

Closed
@kirillkh

Description

@kirillkh

I found at least two cases in the standard API where milliseconds are represented by u32 variables:
std::sync::Condvar::wait_timeout_ms() and std::thread::park_timeout_ms(). However unlikely, it is not completely impossible for the user to expect being able to pass parameter value >= 2^32, as that value is less than 50 days. Also note that milliseconds are often passed on from another API that deals with u64 values, and so the user will likely convert the value unconditionally, without checking whether it's safe to do so.

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