Skip to content

Commit

Permalink
channel: Do not cache thread id on aarch64 linux
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed May 22, 2022
1 parent 80224bc commit dcbea2a
Showing 1 changed file with 9 additions and 0 deletions.
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()
}

0 comments on commit dcbea2a

Please sign in to comment.