Skip to content

Commit

Permalink
Use const thread_local
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b1d437a commit 2c1f522
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1049,7 +1049,7 @@ impl<T, B: Borrow<Inner<T>> + Unpin> Listener<T, B> {

std::thread_local! {
/// Cached thread-local parker/unparker pair.
static PARKER: RefCell<Option<(Parker, Task)>> = RefCell::new(None);
static PARKER: RefCell<Option<(Parker, Task)>> = const { RefCell::new(None) };
}

// Try to borrow the thread-local parker/unparker pair.

0 comments on commit 2c1f522

Please sign in to comment.