about summary refs log tree commit diff
path: root/src/libstd/thread
AgeCommit message (Collapse)AuthorLines
2017-05-06Auto merge of #41768 - rap2hpoutre:patch-4, r=frewsxcvbors-0/+22
Add an example to std::thread::Result type This PR is a part of https://github.com/rust-lang/rust/issues/29378. I submit this PR with the help (mentoring) of @steveklabnik. I'm still not sure my request is good enough but I don't want to spoil the issue with too much questions so I continue here. r? @steveklabnik
2017-05-05std: Prevent deadlocks in doctests on WindowsAlex Crichton-1/+3
Windows historically has problems with threads panicking and the main thread exiting at the same time, typically causing deadlocks. In the past (#25824) we've joined on threads but this just prevents running the test for now to avoid tampering with the example.
2017-05-05Update mod.rsRaphaël Huchet-1/+1
2017-05-05Add an example to std::thread::Result typeRaphaël Huchet-0/+22
2017-05-04Update mod.rsRaphaël Huchet-1/+1
2017-05-04create link to ResultRaphaël Huchet-0/+1
2017-05-04Join method returns a thread::ResultRaphaël Huchet-1/+1
2017-04-26restructured docs for thread and added linksChristian Poveda-13/+19
2017-04-26added moveChristian Poveda-1/+1
2017-04-25rewrote the thread struct docsChristian Poveda-7/+12
2017-04-12Auto merge of #41008 - sagebind:thread_id, r=alexcrichtonbors-24/+13
Derive Hash for ThreadId + better example Derive `Hash` for `ThreadId` (see comments in #21507). Useful for making maps based on thread, e.g. `HashMap<ThreadId, ?>`. Also update example code for thread IDs to be more useful.
2017-04-06Fix Markdown issues in the docsOliver Middleton-2/+2
* Since the switch to pulldown-cmark reference links need a blank line before the URLs. * Reference link references are not case sensitive. * Doc comments need to be indented uniformly otherwise rustdoc gets confused.
2017-04-04Use derived Debug for ThreadIdStephen M. Coakley-8/+1
2017-04-03Derive Hash for ThreadId + better exampleStephen M. Coakley-17/+13
2017-04-02std::thread docs: fix link to current()Simon Sapin-1/+1
2017-03-17Rollup merge of #40503 - swgillespie:thread-hack-removal, r=sfacklerCorey Farwell-6/+1
std: remove a workaround for privacy limitations `std::thread::Thread` implements a non-exported `NewThread` trait to allow for internal-only use of `Thread::new`. Nowadays we have `pub(crate)`, which accomplishes the same thing but much more idiomatically. Rustdoc handles this correctly (I checked and I didn't see `Thread::new` on the rustdoc entry for `Thread` with this change), and the stage1 `rustc` emits the correct error still (I'm assuming that the stage1 compiler uses my `libstd`?): ``` $ ./build/x86_64-apple-darwin/stage1/bin/rustc test.rs error: method `new` is private --> test.rs:4:18 | 4 | let thread = thread::Thread::new(None); | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error ```
2017-03-17Rollup merge of #40457 - frewsxcv:frewsxcv-macos, r=steveklabnikCorey Farwell-3/+3
Update usages of 'OSX' (and other old names) to 'macOS'. As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-16/+16
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13std: remove a workaround for privacy limitations that isn't necessary anymoreSean Gillespie-6/+1
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-3/+3
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-02-22Clarify thread::Builder::stack_sizeAleksey Kladov-3/+6
2017-02-15Fix wording in LocalKey documentationStjepan Glavina-2/+2
2017-01-29Fix a few impl stability attributesOliver Middleton-4/+3
The versions show up in rustdoc.
2017-01-27Fix a few links in the docsOliver Middleton-2/+2
2017-01-20Rollup merge of #38761 - frewsxcv:thread-sleep-formatting, r=alexcrichtonAlex Crichton-3/+6
Add 'platform-specific' section to `sleep_ms` to match `sleep`. None
2017-01-01Auto merge of #38548 - GuillaumeGomez:thread_struct_docs, r=frewsxcvbors-0/+65
Add missing example for Thread struct r? @frewsxcv
2017-01-01Add 'platform-specific' section to `sleep_ms` to match `sleep`.Corey Farwell-3/+6
2016-12-31Add missing example for Thread structGuillaume Gomez-0/+65
2016-12-29Rollup merge of #38491 - GuillaumeGomez:builder_docs, r=frewsxcvAlex Crichton-3/+58
Builder docs r? @frewsxcv
2016-12-24Rollup merge of #38572 - GuillaumeGomez:join_handle_docs, r=frewsxcvSteve Klabnik-6/+40
Add JoinHandle missing examples r? @frewsxcv
2016-12-24Add JoinHandle missing examplesGuillaume Gomez-6/+40
2016-12-24Add missing doc examples for BuilderGuillaume Gomez-3/+58
2016-12-21Add missing examples in some thread functionsGuillaume Gomez-8/+43
2016-12-20Rollup merge of #38006 - frewsxcv:libstd-debug, r=alexcrichtonAlex Crichton-1/+32
Implement `fmt::Debug` for all structures in libstd. Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-1/+32
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-18Add missing urls for thread doc moduleGuillaume Gomez-24/+38
2016-11-01Document reasoning for supporting both fast and OS TLS in the same binBrian Anderson-0/+9
2016-11-01std: Move elf TLS to sys::fast_thread_localBrian Anderson-162/+3
2016-10-22Add Fuchsia supportRaph Levien-30/+42
Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
2016-10-10Auto merge of #36341 - sagebind:thread_id, r=alexcrichtonbors-0/+59
Add ThreadId for comparing threads This adds the capability to store and compare threads with the current calling thread via a new struct, `std::thread::ThreadId`. Addresses the need outlined in issue #21507. This avoids the need to add any special checks to the existing thread structs and does not rely on the system to provide an identifier for a thread, since it seems that this approach is unreliable and undesirable. Instead, this simply uses a lazily-created, thread-local `usize` whose value is copied from a global atomic counter. The code should be simple enough that it should be as much reliable as the `#[thread_local]` attribute it uses (however much that is). `ThreadId`s can be compared directly for equality and have copy semantics. Also see these other attempts: - rust-lang/rust#29457 - rust-lang/rust#29448 - rust-lang/rust#29447 And this in the RFC repo: rust-lang/rfcs#1435
2016-10-07Unlock guard before overflow panicStephen M. Coakley-0/+1
2016-10-05Use mutex to guard thread ID counterStephen M. Coakley-30/+8
2016-10-05Generate ID using u64 + atomic spinlockStephen M. Coakley-14/+54
2016-09-30Auto merge of #36339 - brson:emscripten-new, r=alexcrichtonbors-2/+2
Working asmjs and wasm targets This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman. It does a few things: - Updates LLVM with the emscripten [fastcomp](https://github.com/rust-lang/llvm/pull/50) patches, which include the pnacl IR legalizer and the asm.js backend. This patch is thought not to have any significant effect on existing targets. - Teaches rustbuild to correctly link C code with emscripten - Updates gcc-rs to work correctly with emscripten - Teaches rustbuild to run crate tests for emscripten with node - Modifies Thread::new to return an error on emscripten, to facilitate debugging a common failure mode - Modifies libtest to run in single-threaded mode for emscripten - Ignores a host of tests that don't work yet, mostly dealing with threads and I/O - Updates libc with wasm32 definitions (presently the same as asmjs) - Adds a wasm32-unknown-emscripten target that feeds the output of LLVM's asmjs backend through emcc to generate wasm Notes and caveats: - This is only known to work with `--enable-rustbuild`. - The wasm32 target can't be tested correctly yet because of issues in compiletest and limitations in node https://github.com/kripken/emscripten/issues/4542, but hello.rs does seem to work when run on node via the binaryen interpreter - This requires an up to date installation of the emscripten sdk from its incoming branch - Unwinding is very broken - When enabling the emscripten targets jemalloc is disabled for all targets, which results in test failures for the host Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies. https://github.com/rust-lang/rust/issues/36317 tracks work on this. Fixes https://github.com/rust-lang/rust/issues/36515 Fixes https://github.com/rust-lang/rust/issues/36515 Fixes https://github.com/rust-lang/rust/issues/36356
2016-09-30Ignore various entire test modules on emscriptenBrian Anderson-27/+2
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+25
2016-09-16Update to new macro url syntaxGuillaume Gomez-1/+1
2016-09-08Fix testsStephen M. Coakley-2/+2
2016-09-07Add ThreadId for comparing threadsStephen M. Coakley-0/+40
2016-09-04Clean up thread-local storage docsAndrew Paseltiner-20/+15
`std` no longer contains an implementation of scoped TLS.