Skip to content

Commit

Permalink
Rollup merge of #103017 - fortanix:raoul/sgx_tls_fix, r=ChrisDenton
Browse files Browse the repository at this point in the history
Avoid dropping TLS Key on sgx

#102655 reenabled dropping thread local `Key` on every platform ([library/std/src/sys_common/thread_local_key.rs](rust-lang-ci@fa0ca78#diff-5cb9acf9e243f35c975fa9fbac4885519dc104626bc03610dfa7a20bc79641ceL237-R215)). That's causing problems at least for sgx.

cc: `@jethrogb` `@ChrisDenton`
  • Loading branch information
matthiaskrgr authored Oct 14, 2022
2 parents fbb0c31 + c46185b commit d47b755
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/sys/sgx/abi/tls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl Tls {
rtabort!("TLS limit exceeded")
};
TLS_DESTRUCTOR[index].store(dtor.map_or(0, |f| f as usize), Ordering::Relaxed);
unsafe { Self::current() }.data[index].set(ptr::null_mut());
Key::from_index(index)
}

Expand Down

0 comments on commit d47b755

Please sign in to comment.