about summary refs log tree commit diff
path: root/src/libstd/sync
AgeCommit message (Collapse)AuthorLines
2017-10-08cfg out Queue::new for emscriptenJLockerman-1/+1
Queue::new is only used is tests atm, which causes warnings on emscripten which does not run queue tests.
2017-10-04Add missing urls for MutexGuillaume Gomez-7/+17
2017-10-01Improve performance of spsc_queue and stream.Joshua Lockerman-99/+206
This commit makes two main changes. 1. It switches the spsc_queue node caching strategy from keeping a shared counter of the number of nodes in the cache to keeping a consumer only counter of the number of node eligible to be cached. 2. It separate the consumer and producers fields of spsc_queue and stream into a producer cache line and consumer cache line.
2017-09-22std::sync::RwLock docs improvementLucas Morales-13/+120
2017-09-16change #![feature(const_fn)] to specific gatesAlex Burka-0/+1
2017-08-17Rollup merge of #43891 - Fourchaux:master, r=steveklabnikCorey Farwell-1/+1
Fix typos & us spellings Fixing some typos and non en-US spellings. (Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-4/+4
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-08-10Auto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1bors-1/+1
Fixed mutable vars being marked used when they weren't #### NB : bootstrapping is slow on my machine, even with `keep-stage` - fixes for occurances in the current codebase are <s>in the pipeline</s> done. This PR is being put up for review of the fix of the issue. Fixes #43526, Fixes #30280, Fixes #25049 ### Issue Whenever the compiler detected a mutable deref being used mutably, it marked an associated value as being used mutably as well. In the case of derefencing local variables which were mutable references, this incorrectly marked the reference itself being used mutably, instead of its contents - with the consequence of making the following code emit no warnings ``` fn do_thing<T>(mut arg : &mut T) { ... // don't touch arg - just deref it to access the T } ``` ### Fix Make dereferences not be counted as a mutable use, but only when they're on borrows on local variables. #### Why not on things other than local variables? * Whenever you capture a variable in a closure, it gets turned into a hidden reference - when you use it in the closure, it gets dereferenced. If the closure uses the variable mutably, that is actually a mutable use of the thing being dereffed to, so it has to be counted. * If you deref a mutable `Box` to access the contents mutably, you are using the `Box` mutably - so it has to be counted.
2017-08-08Use explicit wrapping_add to prevent potential unexpected behavior on debug ↵Stefan Schindler-1/+1
builds
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-1/+1
2017-07-10Correct some stability attributesOliver Middleton-3/+3
These show up in rustdoc so need to be correct.
2017-06-22Ensure Guard types impl Display & DebugChris MacNaughton-0/+21
Fixes #24372
2017-06-21Rollup merge of #42397 - sfackler:syncsender-sync, r=alexcrichtonCorey Farwell-5/+0
Implement Sync for SyncSender r? @alexcrichton
2017-06-15Fix condvar.wait(distant future) return immediately on OSXStepan Koltsov-15/+51
Fixes issue #37440: `pthread_cond_timedwait` on macOS Sierra seems to overflow `ts_sec` parameter and returns immediately. To work around this problem patch rounds timeout down to approximately 1000 years. Patch also fixes overflow when converting `u64` to `time_t`.
2017-06-02Implement Sync for SyncSenderSteven Fackler-5/+0
2017-06-02Rewrite `Receiver::try_iter` doc example to show resulting values.Corey Farwell-8/+13
2017-06-02Rewrite `Receiver::iter` doc example to show resulting values.Corey Farwell-6/+8
2017-06-01Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakisbors-10/+10
Decompose Adjustment into smaller steps and remove the method map. The method map held method callee information for: * actual method calls (`x.f(...)`) * overloaded unary, binary, indexing and call operators * *every overloaded deref adjustment* (many can exist for each expression) That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with: * a desire to compose adjustments more freely * containing the autoderef logic better to avoid mutation within an inference snapshot * not creating `TyFnDef` types which are incompatible with the original one * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs` * to fix #3548 by explicitly writing autorefs for the RHS of comparison operators Individual commits tell their own story, of "atomic" changes avoiding breaking semantics. Future work based on this PR could include: * removing the signature from `TyFnDef`, now that it's always "canonical" * some questions of variance remain, as subtyping *still* treats the signature differently * moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits` * allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments * transitive coercions (e.g. reify or unsize after multiple steps of autoderef) r? @nikomatsakis
2017-06-01tests: fix fallout from empowering unused_allocation in comparisons.Eduard-Mihai Burtescu-10/+10
2017-05-31Rewrite doc examples for `Receiver::recv_timeout`.Corey Farwell-4/+33
2017-05-22libstd/sync/mpsc: relicense under rust licenseDmitry Vyukov-54/+20
These files are licensed under a different license than the rest of the codebase. This causes potential issues and inconveniences. Relicense these files under the standard license. I hold original copyright on that code. Fixes #36556
2017-05-20Auto merge of #42111 - ollie27:stab, r=Mark-Simulacrumbors-9/+9
Correct some stability versions These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-05-20Correct some stability versionsOliver Middleton-9/+9
These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-05-18fix typo in libstd/sync/mpsc/mod.rs docsDenis Andrejew-1/+1
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-26Adding links and examples for various mspc pages #29377projektir-29/+254
2017-04-22Fix invalid linkageGuillaume Gomez-1/+1
2017-04-10Auto merge of #41103 - projektir:channel_error_docs, r=GuillaumeGomezbors-50/+84
Channel error docs r? @steveklabnik I'm going to need some help on this one, a few ambiguities.
2017-04-09Minor fix to mutex exampleGeoffry Song-1/+1
Presumably `N` was supposed to be used in both places.
2017-04-08Adding links around Sender/SyncSender/Receiver errors; Adding more ↵projektir-50/+84
documentation to channel() and sync_channel(); adding more links #29377
2017-04-05Rollup merge of #40981 - Technius:master, r=steveklabnikCorey Farwell-46/+172
Add links and some examples to std::sync::mpsc docs Addresses part of #29377 r? @steveklabnik I took a stab at adding links to the `std::sync::mpsc` docs, and I also wrote a few examples. Edit: Whoops, typed in `?r` instead of `r?`.
2017-04-05Rollup merge of #40977 - projektir:BarrierWaitResult_doc, r=steveklabnikCorey Farwell-5/+4
Updating the description for BarrierWaitResult #29377 Referencing `Barrier`, removing reference to `is_leader`.
2017-04-05Rollup merge of #40608 - GuillaumeGomez:mutex-doc-inconsistency, r=steveklabnikCorey Farwell-7/+7
Fix mutex's docs inconsistency Fixes #40176. r? @steveklabnik cc @rust-lang/docs
2017-04-03Fix styling issuesBryan Tan-6/+17
2017-04-03Fix mutex's docs inconsistencyGuillaume Gomez-7/+7
2017-03-31Fix warnings in examplesBryan Tan-9/+9
2017-03-31Fix broken links to std::iter::Iterator::nextBryan Tan-2/+2
2017-03-31Add links and examples to std::sync::mpsc docs (#29377)Bryan Tan-31/+136
This change adds links to to `Receiver`, `Iter`, `TryIter`, `IntoIter`, `Sender`, `SyncSender`, `SendError`, `RecvError`, `TryRecvError`, `RecvTimeoutError`, `TrySendError`, `Sender::send`, `SyncSender::send`, `SyncSender::try_send`, `Receiver::recv`, `Receiver::recv_timeout`, `Receiver::iter`, and `Receiver::try_iter`. Examples added to `Receiver`, `Sender`, `Receiver::iter`.
2017-03-31Updating the description for BarrierWaitResult #29377projektir-5/+4
2017-03-30Add links to std::sync::mpsc docs #29377Bryan Tan-15/+25
2017-03-29Adding linking for Once docs #29377projektir-8/+29
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-26/+26
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-28Rollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcvCorey Farwell-16/+230
Add missing urls and examples for Condvar docs r? @frewsxcv
2017-02-24Rollup merge of #40052 - GuillaumeGomez:sunc_docs, r=frewsxcvGuillaume Gomez-1/+3
Add missing urls in MutexGuard docs r? @frewsxcv
2017-02-23Add missing urls in MutexGuard docsGuillaume Gomez-1/+3
2017-02-23Add missing urls and examples for Condvar docsGuillaume Gomez-16/+230