Skip to content

Risk of Spurious Wakeups - Conditional Variable Usage with if Statement #522

Description

@octopus-kkk

Hi, developers,
I came across the following code snippet, where the condition for waiting on the condition variable is checked using an if statement:
platforms/windows/src/tests/mod.rs#L224

Could this potentially lead to spurious wakeups? Would it be better to use a while loop instead to ensure the condition is rechecked after each wakeup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions