Skip to content

Commit

Permalink
Thread stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
terrarier2111 committed Jul 20, 2023
1 parent b5221a2 commit 861ace3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

#![warn(missing_docs)]
#![allow(clippy::mutex_atomic)]
#![cfg_attr(feature = "nightly", feature(thread_local, core_intrinsics))]
#![cfg_attr(feature = "nightly", feature(thread_local))]

mod cached;
mod mutex;
Expand Down
3 changes: 1 addition & 2 deletions src/thread_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::{mem, ptr};
use std::mem::MaybeUninit;
use std::num::NonZeroUsize;
use std::ptr::{addr_of, null};
use likely_stable::likely;

/// Thread ID manager which allocates thread IDs. It attempts to aggressively
/// reuse thread IDs where possible to avoid cases where a ThreadLocal grows
Expand Down Expand Up @@ -140,8 +141,6 @@ cfg_if::cfg_if! {
/// Returns a thread ID for the current thread, allocating one if needed.
#[inline]
pub(crate) fn get() -> Thread {
use std::intrinsics::likely;
// prefetch_read_data();
let thread = unsafe { *THREAD.get() };
if likely(!thread.self_ptr.is_null()) {
unsafe { thread.self_ptr.read() }
Expand Down

0 comments on commit 861ace3

Please sign in to comment.