Skip to content

<future>: What's the purpose of _Associated_state::_Ready_at_thread_exit? #3740

@achabense

Description

@achabense

The member variable _Associated_state::_Ready_at_thread_exit is set as false on construction, and never modified elsewhere. What does it do?
https://github.com/microsoft/STL/blob/a62109595b6d89e08172fdf4beb75a2670fe0cc9/stl/inc/future#L208?plain=1

Its associated functions are _Is_ready_at_thread_exit and _Make_ready_at_thread_exit.
_Is_ready_at_thread_exit always returns false and is widely referred to in <future>. (search result)

STL/stl/inc/future

Lines 373 to 375 in a621095

bool _Is_ready_at_thread_exit() const noexcept {
return _Ready_at_thread_exit;
}

_Make_ready_at_thread_exit is always a no-op, and is not used anywhere. (search result)

STL/stl/inc/future

Lines 398 to 402 in a621095

void _Make_ready_at_thread_exit() { // set ready status at thread exit
if (_Ready_at_thread_exit) {
_Ready = true;
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improved

    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