Skip to content

Commit

Permalink
Unlock guard before overflow panic
Browse files Browse the repository at this point in the history
  • Loading branch information
sagebind committed Oct 7, 2016
1 parent e80fd25 commit 032bffa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/thread/mod.rs
Expand Up @@ -550,6 +550,7 @@ impl ThreadId {
// 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 {
GUARD.unlock();
panic!("failed to generate unique thread ID: bitspace exhausted");
}

Expand Down

0 comments on commit 032bffa

Please sign in to comment.