-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #112890
Rollup of 7 pull requests #112890
Conversation
Co-authored-by: yvt <i@yvt.jp>
This reverts commit a45fc94
Document memory orderings of `thread::{park, unpark}` Document `thread::park/unpark` as having acquire/release synchronization. Without that guarantee, even the example in the documentation can deadlock: ```rust let flag = Arc::new(AtomicBool::new(false)); let t2 = thread::spawn(move || { while !flag.load(Ordering::Acquire) { thread::park(); } }); flag.store(true, Ordering::Release); t2.thread().unpark(); // t1: flag.store(true) // t1: thread.unpark() // t2: flag.load() == false // t2 now parks, is immediately unblocked but never // acquires the flag, and thus spins forever ``` Multiple calls to `unpark` should also maintain a release sequence to make sure operations released by previous `unpark`s are not lost: ```rust let a = Arc::new(AtomicBool::new(false)); let b = Arc::new(AtomicBool::new(false)); let t2 = thread::spawn(move || { while !a.load(Ordering::Acquire) || !b.load(Ordering::Acquire) { thread::park(); } }); thread::spawn(move || { a.store(true, Ordering::Release); t2.thread().unpark(); }); b.store(true, Ordering::Release); t2.thread().unpark(); // t1: a.store(true) // t1: t2.unpark() // t3: b.store(true) // t3: t2.unpark() // t2 now parks, is immediately unblocked but never // acquires the store of `a`, only the store of `b` which // was released by the most recent unpark, and thus spins forever ``` This is of course a contrived example, but is reasonable to rely upon in real code. Note that all implementations of park/unpark already comply with the rules, it's just undocumented.
…e-creation, r=notriddle [rustdoc] partially fix invalid files creation Part of rust-lang#111249. It only removes generation for modules which shouldn't exist. For files, we need the compiler to keep re-export information alive for external items so we can actually have the right path to their location as it's currently not generating them correctly. In case the item is inlined, it shouldn't (and neither should its children) get a file generated. r? ```@notriddle```
…oli-obk Add `lazy_type_alias` feature gate Add the `type_alias_type` to be able to have the weak alias used without restrictions. Part of rust-lang#112792. cc `@compiler-errors` r? `@oli-obk`
…san68 Fix copy-paste typo in `eprint(ln)` docs Fixes rust-lang#112862
Make queries traceable again This can't be tested without something along the lines of rust-lang#111924 unfortunately. We could benchmark turning query tracing into an `info` level tracing statement, but let's get this fix landed first so we can actually debug properly again
Fix msg passed to span_bug
…rtlarsan68 Revert 'Rename profile=user to profile=dist' This reverts commit a45fc94 (rust-lang#112166) Reverted as it didn't meet the requirements (rust-lang#112166 (comment)) and is causing issues (closes rust-lang#112846) cc ``@AnakinSkywalkeer``
@bors r+ p=7 rollup=never |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR: previous master: 38b44eb233 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (536635c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 659.034s -> 660.125s (0.17%) |
Successful merges:
thread::{park, unpark}
#99587 (Document memory orderings ofthread::{park, unpark}
)lazy_type_alias
feature gate #112853 (Addlazy_type_alias
feature gate)eprint(ln)
docs #112863 (Fix copy-paste typo ineprint(ln)
docs)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup