about summary refs log tree commit diff
path: root/src/libstd/sys/unix/thread.rs
AgeCommit message (Collapse)AuthorLines
2015-02-17Revise std::thread semanticsAaron Turon-3/+5
This commit makes several changes to `std::thread` in preparation for final stabilization: * It removes the ability to handle panics from `scoped` children; see #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 #20807 [breaking-change]
2015-02-11fixing trailing whitespace errorsDave Huseby-1/+1
2015-02-11bitrig integrationDave Huseby-2/+33
2015-02-01openbsd: rebase to masterSébastien Marie-3/+6
- incoporate changes introduced by #21678
2015-02-01openbsd supportSébastien Marie-5/+45
2015-01-28Thread native name setting, fix #10302Vojtech Kral-1/+1
2015-01-28Thread native name setting, fix #10302Vojtech Kral-1/+1
2015-01-28Thread native name setting, fix #10302Vojtech Kral-15/+14
2015-01-27Thread native name setting, fix #10302Vojtech Kral-2/+2
2015-01-27Thread native name setting, fix #10302Vojtech Kral-0/+40
2015-01-11Give mmap a page-aligned stack start addressClifford Caoile-1/+13
2014-12-18Revise std::thread API to join by defaultAaron Turon-3/+4
This commit is part of a series that introduces a `std::thread` API to replace `std::task`. In the new API, `spawn` returns a `JoinGuard`, which by default will join the spawned thread when dropped. It can also be used to join explicitly at any time, returning the thread's result. Alternatively, the spawned thread can be explicitly detached (so no join takes place). As part of this change, Rust processes now terminate when the main thread exits, even if other detached threads are still running, moving Rust closer to standard threading models. This new behavior may break code that was relying on the previously implicit join-all. In addition to the above, the new thread API also offers some built-in support for building blocking abstractions in user space; see the module doc for details. Closes #18000 [breaking-change]
2014-12-18libs: merge librustrt into libstdAaron Turon-0/+270
This commit merges the `rustrt` crate into `std`, undoing part of the facade. This merger continues the paring down of the runtime system. Code relying on the public API of `rustrt` will break; some of this API is now available through `std::rt`, but is likely to change and/or be removed very soon. [breaking-change]