Skip to content

Tracking Issue for JoinHandle::is_finished #90470

Closed

Description

@m-ou-se

Feature gate: #![feature(thread_is_running)]

Public API

impl<T> JoinHandle<T> {
    pub fn is_finshed(&self) -> bool;
}

Steps / History

Unresolved Questions

Activity

  1. added
    T-libs-api[DEPRECATED; DO NOT USE]
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Nov 1, 2021
  2. m-ou-se commented on Feb 15, 2022

    @m-ou-se
    MemberAuthor

    I think the unresolved questions above can be ideas for future additions, but aren't blockers for this API.

    @rfcbot merge

  3. rfcbot commented on Feb 15, 2022

    @rfcbot

    Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members:

    No concerns currently listed.

    Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

    See this document for info about what commands tagged team members can give me.

  4. added
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.
    on Feb 15, 2022
  5. joshtriplett commented on Feb 15, 2022

    @joshtriplett
    Member

    I feel like the comment on the PR about try_join (ignoring any naming questions) seemed right: the use case for this seems like "check is_running and then immediately join, but don't block for any appreciable amount of time".

    That said, the type signature (fn try_join(self) -> Result<..., Self> would be annoying to deal with in practice, and it doesn't seem like a good idea to make it work with &self instead.

    Given those constraints, this seems like a reasonable API. However, I think I'm going to submit a PR for the documentation, to steer people away from tight-polling on it, and document the intended use case.

    @rfcbot reviewed

  6. joshtriplett commented on Feb 15, 2022

    @joshtriplett
    Member
  7. rfcbot commented on Feb 16, 2022

    @rfcbot

    🔔 This is now entering its final comment period, as per the review above. 🔔

  8. added
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    and removed
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    on Feb 16, 2022
  9. workingjubilee commented on Feb 20, 2022

    @workingjubilee
    Member

    Hm. At the risk of getting philosophical, what does it mean for a thread to be "running", if this would return true when the thread is sleeping?

    And did this get answered in the negative?

    Wouldn't detaching the thread after pulling out the result work on platforms that don't have a non-blocking join?

  10. Amanieu commented on Feb 20, 2022

    @Amanieu
    Member

    I think the question that you are usually asking is "has this thread finished running" rather than "is this thread still running". Perhaps this function could be inverted and renamed to "is_finished"?

  11. workingjubilee commented on Feb 21, 2022

    @workingjubilee
    Member

    While an async method was decided against, I will note Poll uses the idiom is_ready or is_pending.

  12. Julian-Wollersberger commented on Feb 24, 2022

    @Julian-Wollersberger
    Contributor

    +1 for @Amanieu's suggestion.
    Since the intended use case is more or less if !is_running() { join() }, it would be clearer to invert the function name: if is_finished() { join() }

  13. 36 remaining items

  14. m-ou-se commented on Mar 9, 2022

    @m-ou-se
    MemberAuthor

    Let's try again with the new name. Now it's is_finished() rather than is_running(). That removes any ambiguity when the thread is sleeping or blocked (not 'running' (depending on your definition), but still not finished).

    @rfcbot merge

  15. rfcbot commented on Mar 9, 2022

    @rfcbot

    Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members:

    No concerns currently listed.

    Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

    See this document for info about what commands tagged team members can give me.

  16. added
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    and removed
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    on Mar 9, 2022
  17. rfcbot commented on Mar 9, 2022

    @rfcbot

    🔔 This is now entering its final comment period, as per the review above. 🔔

  18. added
    to-announceAnnounce this issue on triage meeting
    and removed
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    on Mar 19, 2022
  19. rfcbot commented on Mar 19, 2022

    @rfcbot

    The final comment period, with a disposition to merge, as per the review above, is now complete.

    As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

    This will be merged soon.

  20. added 2 commits that reference this issue on Mar 30, 2022
    99df494
    32c5a57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions