Replace Linux Mutex and Condvar with futex based ones. by m-ou-se · Pull Request #95035 · rust-lang/rust (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

m-ou-se

@m-ou-se m-ou-se added the T-libs

Relevant to the library team, which will review and decide on the PR/issue.

label

Mar 17, 2022

1 similar comment

matklad

@m-ou-se m-ou-se marked this pull request as ready for review

March 23, 2022 14:12

Amanieu

@m-ou-se

bjorn3

@m-ou-se

@joshtriplett joshtriplett added the relnotes

Marks issues that should be documented in the release notes of the next release.

label

Apr 14, 2022

This was referenced

Apr 25, 2022

This was referenced

May 26, 2022

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 19, 2022

@bors

Make {Mutex, Condvar, RwLock}::new() const.

This makes it possible to have static M: Mutex<_> = Mutex::new(..); 🎉

Our implementations on Linux, on Windows, and various BSDs and some tier 3 platforms have already been using a non-allocating const-constructible implementation. As of rust-lang#97647, the remaining platforms (most notably macOS) now have a const-constructible implementation as well. This means we can finally make these functions publicly const.

Tracking issue: rust-lang#93740

@nnmm nnmm mentioned this pull request

Jul 4, 2022

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request

Jul 12, 2022

@he32

@yvt yvt mentioned this pull request

Aug 14, 2022

yvt added a commit to r3-os/r3 that referenced this pull request

Aug 14, 2022

@yvt

This drop call is intended to cut short the borrow 'a maintained by a reference-containing Mutex<&'a mut _>, but actually it's unnecessary because Mutex's contained data (&'a mut _) is not subject to drop check, hence the borrow is allowed to expire before the containing Mutex is dropped.

As for the drop_non_drop lint, I would say it's a false-positive because not every target supported by std has a trivial destructor for Mutex. This lint started to trigger only recently because rust-lang/rust#95035 replaced the Mutex implementation with a futex-based one on Linux.

yorickpeterse added a commit to inko-lang/inko that referenced this pull request

Aug 20, 2022

@yorickpeterse

As of rust-lang/rust#95035, the locking API provided by std::sync is improved on Linux, outperforming parking_lot in various cases. Using the built-in locking APIs means we can remove parking_lot as a dependency, along with its own (indirect) dependencies; removing a total of 10 dependencies.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request

Aug 31, 2022

@he32

Pkgsrc changes:

Upstream changes:

Version 1.62.1 (2022-07-19)

Rust 1.62.1 addresses a few recent regressions in the compiler and standard library, and also mitigates a CPU vulnerability on Intel SGX.

Version 1.62.0 (2022-06-30)

Language

Compiler

* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

Stabilized APIs

Clippy

Cargo

Compatibility Notes

Internal Changes

These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.

Version 1.61.0 (2022-05-19)

Language

Compiler

Libraries

Stabilized APIs

These APIs are now usable in const contexts:

Cargo

No feature changes, but see compatibility notes.

Compatibility Notes

Internal Changes

These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.

workingjubilee pushed a commit to tcdi/postgrestd that referenced this pull request

Sep 15, 2022

@bors

Make {Mutex, Condvar, RwLock}::new() const.

This makes it possible to have static M: Mutex<_> = Mutex::new(..); 🎉

Our implementations on Linux, on Windows, and various BSDs and some tier 3 platforms have already been using a non-allocating const-constructible implementation. As of rust-lang/rust#97647, the remaining platforms (most notably macOS) now have a const-constructible implementation as well. This means we can finally make these functions publicly const.

Tracking issue: rust-lang/rust#93740

@Tpt Tpt mentioned this pull request

Sep 22, 2022

@gz gz mentioned this pull request

Jun 24, 2024