microsoft / microsoft/STL

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

Open
#3,740 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
11.2k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

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)
https://github.com/microsoft/STL/blob/a62109595b6d89e08172fdf4beb75a2670fe0cc9/stl/inc/future#L373-L375
_Make_ready_at_thread_exit is always a no-op, and is not used anywhere. (search result)
https://github.com/microsoft/STL/blob/a62109595b6d89e08172fdf4beb75a2670fe0cc9/stl/inc/future#L398-L402

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in stl/inc/future around _Associated_state::_Ready_at_thread_exit and the _Is_ready_at_thread_exit and _Make_ready_at_thread_exit functions cited in the issue. Trace their references and compare them with the relevant future behavior to determine whether they are required. Done means the issue has a justified explanation or a clearly scoped cleanup decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.