summary refs log tree commit diff
path: root/src/libstd/thread/mod.rs
AgeCommit message (Collapse)AuthorLines
2017-05-09Address review commentsFelix Raimundo-2/+4
2017-05-09Add a link to `thread::Builder` in `thread::spawn`Felix Raimundo-0/+5
2017-05-09Add more examples to `thread::spawn`Felix Raimundo-6/+51
Part of #29378
2017-05-07Fix typos in `thread::park` documentation.Felix Raimundo-4/+6
2017-05-07Update the `thread::Thread` documentation.Felix Raimundo-24/+12
- Copied the module documentation to `Thread`. - Removed the example because it did not use any method of Thread.
2017-05-07Add stack size doc to `thread::spawn`.Felix Raimundo-0/+7
Part of #29378
2017-05-07Inline `thread::park` documentation.Felix Raimundo-52/+62
Part of #29378 - Moves the module documentation into `park`. - Add the same example as the one from `unpark` to `park`.
2017-05-07Improve `thread::panicking` documentaion.Felix Raimundo-0/+12
Part of #29378
2017-05-07fix typoFelix Raimundo-2/+2
2017-05-07Better example for `thread::unpark`.Felix Raimundo-5/+12
Part of #29378
2017-05-07Add `park` info to `unpark`.Felix Raimundo-1/+8
- Adds an explanantion of what `park` does in the `unpark` documentation. - Adds a link to the module doc.
2017-05-07Add link to the module doc in `park_timeout`.Felix Raimundo-1/+2
Part of #29378
2017-05-07Add a link to `park` in the `park_timeout` doc.Felix Raimundo-6/+9
Part of #29378
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-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-02-22Clarify thread::Builder::stack_sizeAleksey Kladov-3/+6
2017-01-29Fix a few impl stability attributesOliver Middleton-2/+2
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-0/+15
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-0/+15
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-1/+1
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