Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 10, 2021
1 parent 2750d3a commit dbc2b55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,12 +999,12 @@ impl ThreadId {
static mut COUNTER: u64 = 1;

unsafe {
let _guard = GUARD.lock();
let guard = GUARD.lock();

// If we somehow use up all our bits, panic so that we're not
// covering up subtle bugs of IDs being reused.
if COUNTER == u64::MAX {
drop(_guard); // in case the panic handler ends up calling `ThreadId::new()`, avoid reentrant lock acquire.
drop(guard); // in case the panic handler ends up calling `ThreadId::new()`, avoid reentrant lock acquire.
panic!("failed to generate unique thread ID: bitspace exhausted");
}

Expand Down

0 comments on commit dbc2b55

Please sign in to comment.