File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -242,21 +242,21 @@ impl<'tcx> TlsDtorsState<'tcx> {
242
242
match & mut self . 0 {
243
243
Init => {
244
244
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
- }
249
245
"macos" => {
250
246
// The macOS thread wide destructor runs "before any TLS slots get
251
247
// freed", so do that first.
252
248
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.
254
254
break ' new_state PthreadDtors ( Default :: default ( ) ) ;
255
255
}
256
256
"windows" => {
257
257
// Determine which destructors to run.
258
258
let dtors = this. lookup_windows_tls_dtors ( ) ?;
259
- // And move to the final state.
259
+ // And move to the next state, that runs them .
260
260
break ' new_state WindowsDtors ( dtors) ;
261
261
}
262
262
_ => {
You can’t perform that action at this time.
0 commit comments