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

channel: Do not cache thread id on aarch64 linux #836

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions crossbeam-channel/src/waker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ impl Drop for SyncWaker {
}

/// Returns the id of the current thread.
#[cfg(not(all(target_arch = "aarch64", target_os = "linux")))]
#[inline]
fn current_thread_id() -> ThreadId {
thread_local! {
Expand All @@ -284,3 +285,11 @@ fn current_thread_id() -> ThreadId {
.try_with(|id| *id)
.unwrap_or_else(|_| thread::current().id())
}
// Do not cache thread id on aarch64 linux because is is buggy:
// https://github.com/crossbeam-rs/crossbeam/pull/802
/// Returns the id of the current thread.
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
#[inline]
fn current_thread_id() -> ThreadId {
thread::current().id()
}