about summary refs log tree commit diff
path: root/src/libstd/sync/mutex.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-767/+0
2020-06-13Rewrap comments in Mutex exampleDavid Tolnay-11/+11
2020-06-13Clarify the scope-related explanation Poliorcetics-3/+2
Based on the review made by dtolnay.
2020-06-13Apply suggestions from code reviewPoliorcetics-5/+5
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2020-06-09Remove a lot of unecessary/duplicated commentsAlexis Bourget-11/+3
2020-06-08Simply use drop instead of std::mem::dropPoliorcetics-2/+2
Co-authored-by: LeSeulArtichaut <leseulartichaut@gmail.com>
2020-06-07Improved the example to work with mutable data, providing a reason for the ↵Alexis Bourget-4/+6
mutex holding it
2020-06-07Added an example where explicitly dropping a lock is necessary/a good idea.Alexis Bourget-0/+61
2020-04-22More diagnostic items for Clippy usagePhilipp Hansch-0/+1
This adds a couple of more diagnostic items to be used in Clippy. I chose these particular ones because they were the types which we seem to check for the most in Clippy. I'm not sure if the `cfg_attr(not(test))` is needed, but it was also used for `Vec` and a few other types.
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-1/+1
2019-12-22Format the worldMark Rousskov-27/+35
2019-12-06get rid of __ in field namesRalf Jung-12/+10
2019-05-04Fix intra-doc link resolution failure on re-exporting libstdTaiki Endo-0/+2
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-6/+8
2019-02-28libstd => 2018Taiki Endo-11/+11
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-7/+7
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-17Use more impl header lifetime elisionScott McMurray-7/+7
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-10libs: doc commentsAlexander Regueiro-1/+1
2019-01-17Simplify Debug implementation of MutexGuard.Mara Bos-7/+1
Just transparently print the guarded data, instead of wrapping it in `MutexGuard { lock: Mutex { data: ... } }`.
2019-01-17Make MutexGuard's Debug implementation more useful.Mara Bos-3/+7
Fixes #57702.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-16Replace data.clone() by Arc::clone(&data) in mutex doc.Benoît C-1/+1
Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
2018-09-06Fix invalid urlsGuillaume Gomez-2/+0
2018-06-17libstd: add an RAII utility for sys_common::mutex::MutexNODA, Kai-2/+2
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2018-05-07Add explanation for #[must_use] on mutex guardsManish Goregaokar-1/+1
2017-12-27Correct a few stability attributesOliver Middleton-1/+1
2017-11-18impl From<T> for Mutex<T>Eduardo Pinho-0/+11
2017-10-10Rollup merge of #44775 - MaloJaffre:debug-struct, r=sfacklerkennytm-3/+10
Refactor to use `debug_struct` in several Debug impls Also use `pad` and derive `Debug` for `Edge`. Fixes #44771.
2017-10-09Refactor to use `debug_struct` in several Debug implsMalo Jaffré-3/+10
Fixes #44771.
2017-10-04Add missing urls for MutexGuillaume Gomez-7/+17
2017-07-10Correct some stability attributesOliver Middleton-1/+1
These show up in rustdoc so need to be correct.
2017-06-22Ensure Guard types impl Display & DebugChris MacNaughton-0/+7
Fixes #24372
2017-05-20Correct some stability versionsOliver Middleton-2/+2
These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-04-29need to pick a new feature nameRalf Jung-1/+1
2017-04-29MutexGuard<T> may be Sync only if T is SyncRalf Jung-5/+3
Also remove some unnecessary unsafe impl from the tests.
2017-04-09Minor fix to mutex exampleGeoffry Song-1/+1
Presumably `N` was supposed to be used in both places.
2017-04-03Fix mutex's docs inconsistencyGuillaume Gomez-7/+7
2017-03-19Rollup merge of #40611 - ScottAbbey:patch-1, r=GuillaumeGomezCorey Farwell-1/+1
Fix typo in mutex.rs docs This seems to match other uses of "be accessed" in the document.
2017-03-17Fix typo in mutex.rs docsScottAbbey-1/+1
This seems to match other uses of "be accessed" in the document.
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-3/+3
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-02-23Add missing urls in MutexGuard docsGuillaume Gomez-1/+3
2017-01-29Fix a few impl stability attributesOliver Middleton-1/+1
The versions show up in rustdoc.
2017-01-10Add missing doc examples for MutexGuillaume Gomez-1/+79
2016-12-28Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]`Andrew Paseltiner-2/+1
CC #34761
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+9
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-11-25Document how the `MutexGuard` structure is created.Corey Farwell-1/+8
Also, end sentence with a period.
2016-09-30Ignore various entire test modules on emscriptenBrian Anderson-9/+1
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+8
2016-09-11Documentation of what does for each typeathulappadan-0/+1
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-4/+0