Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise std::thread #22435

Merged
merged 2 commits into from
Feb 18, 2015
Merged

Revise std::thread #22435

merged 2 commits into from
Feb 18, 2015

Commits on Feb 17, 2015

  1. Revise std::thread semantics

    This commit makes several changes to `std::thread` in preparation for
    final stabilization:
    
    * It removes the ability to handle panics from `scoped` children; see
      rust-lang#20807 for discussion
    
    * It adds a `JoinHandle` structure, now returned from `spawn`, which
      makes it possible to join on children that do not share data from
      their parent's stack. The child is automatically detached when the
      handle is dropped, and the handle cannot be copied due to Posix
      semantics.
    
    * It moves all static methods from `std::thread::Thread` to free
      functions in `std::thread`. This was done in part because, due to the
      above changes, there are effectively no direct `Thread` constructors,
      and the static methods have tended to feel a bit awkward.
    
    * Adds an `io::Result` around the `Builder` methods `scoped` and
      `spawn`, making it possible to handle OS errors when creating
      threads. The convenience free functions entail an unwrap.
    
    * Stabilizes the entire module. Despite the fact that the API is
      changing somewhat here, this is part of a long period of baking and
      the changes are addressing all known issues prior to alpha2. If
      absolutely necessary, further breaking changes can be made prior to beta.
    
    Closes rust-lang#20807
    
    [breaking-change]
    aturon committed Feb 17, 2015
    Configuration menu
    Copy the full SHA
    d8f8f7a View commit details
    Browse the repository at this point in the history
  2. Fallout from stabilization

    aturon committed Feb 17, 2015
    Configuration menu
    Copy the full SHA
    d0de2b4 View commit details
    Browse the repository at this point in the history