Skip to content

Generalize condition_variable wakeup #3012

@xemul

Description

@xemul

For the past years we had several attempts from both internal and external contributors to add abort-source as a way to wakeup c.v. from sleep.

The main concern against adding it is to avoid a matrix of every primitive interacting with every other primitive. There is a workaround

auto abort_me = as.subscribe([&] { cv.broadcast(); });
...
co_await cv.when([&] { return as.abort_requested() || other_conditions; });

but it's less than nice and optimal.

Apparently, it's needed badly, but the consensus is yet to be come to.

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