Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita272844

Browse files
committed
Don't perform mitigation for thread-unsafe libc::exit under Miri.
1. Miri's exit is thread-safe2. Miri doesn't (yet) support `libc::gettid`, used in the implementation of the mitigation on Linux.
1 parent5035a17 commita272844

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎std/src/sys/pal/common/exit_guard.rs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
cfg_if::cfg_if!{
2-
if #[cfg(target_os ="linux")]{
2+
if #[cfg(miri)]{
3+
/// Mitigation for <https://github.com/rust-lang/rust/issues/126600>
4+
///
5+
/// This mitigation is not necessary when running under Miri, so this function does nothing
6+
/// when running under Miri.
7+
pub(crate)fn unique_thread_exit(){
8+
// Mitigation not required on Miri, where `exit` is thread-safe.
9+
}
10+
} elseif #[cfg(target_os ="linux")]{
311
/// Mitigation for <https://github.com/rust-lang/rust/issues/126600>
412
///
513
/// On `unix` (where `libc::exit` may not be thread-safe), ensure that only one Rust thread

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp