Skip to content

Commit 7df633d

Browse files
committed
Auto merge of rust-lang#3550 - RalfJung:unix-tls, r=RalfJung
tls dtors: treat all unixes uniformly
2 parents 1961b8b + 4082c24 commit 7df633d

File tree

1 file changed

+6
-6
lines changed
  • src/tools/miri/src/shims

1 file changed

+6
-6
lines changed

src/tools/miri/src/shims/tls.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,21 +242,21 @@ impl<'tcx> TlsDtorsState<'tcx> {
242242
match &mut self.0 {
243243
Init => {
244244
match this.tcx.sess.target.os.as_ref() {
245-
"linux" | "freebsd" | "android" => {
246-
// Run the pthread dtors.
247-
break 'new_state PthreadDtors(Default::default());
248-
}
249245
"macos" => {
250246
// The macOS thread wide destructor runs "before any TLS slots get
251247
// freed", so do that first.
252248
this.schedule_macos_tls_dtor()?;
253-
// When the stack is empty again, go on with the pthread dtors.
249+
// When that destructor is done, go on with the pthread dtors.
250+
break 'new_state PthreadDtors(Default::default());
251+
}
252+
_ if this.target_os_is_unix() => {
253+
// All other Unixes directly jump to running the pthread dtors.
254254
break 'new_state PthreadDtors(Default::default());
255255
}
256256
"windows" => {
257257
// Determine which destructors to run.
258258
let dtors = this.lookup_windows_tls_dtors()?;
259-
// And move to the final state.
259+
// And move to the next state, that runs them.
260260
break 'new_state WindowsDtors(dtors);
261261
}
262262
_ => {

0 commit comments

Comments
 (0)