Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable thread-local destructors on horizon #2

Merged
merged 0 commits into from
Mar 28, 2022
Merged

Enable thread-local destructors on horizon #2

merged 0 commits into from
Mar 28, 2022

Conversation

ian-h-chamberlain
Copy link

@ian-h-chamberlain ian-h-chamberlain commented Mar 25, 2022

@AzureMarker @Meziu

Broken out from Meziu#16

Always use fallback thread_local destructor.

@@ -93,7 +93,7 @@ pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
}
}

#[cfg(target_os = "vxworks")]
#[cfg(target_os = "vxworks", target_os = "horizon")]
pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense to do before enabling #[thread_local]?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's any harm in it, since the only usage of this function is behind a #[cfg(target_thread_local)]: https://github.com/ian-h-chamberlain/rust-horizon/blob/feature/target-thread-local/library/std/src/thread/local.rs#L531

That said, I realized while double checking it that I screwed up the syntax of this cfg, so let me fix that...

Copy link

@Meziu Meziu Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense to do before enabling #[thread_local]?

rust-lang#95341

Will be merged in a couple hours by bors. This PR can get merged.

Edit: merged 👍

@AzureMarker AzureMarker merged this pull request into AzureMarker:feature/horizon-threads Mar 28, 2022
@ian-h-chamberlain ian-h-chamberlain deleted the feature/horizon-threads branch March 28, 2022 03:13
AzureMarker pushed a commit that referenced this pull request Jun 14, 2022
Always use fallback thread_local destructor, since __cxa_thread_atexit_impl
is never defined on the target.

See #2
workingjubilee pushed a commit to tcdi/postgrestd that referenced this pull request Sep 15, 2022
Always use fallback thread_local destructor, since __cxa_thread_atexit_impl
is never defined on the target.

See AzureMarker/rust-horizon#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants