Skip to content

Commit 032bffa

Browse files
committed
Unlock guard before overflow panic
1 parent e80fd25 commit 032bffa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libstd/thread/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ impl ThreadId {
550550
// If we somehow use up all our bits, panic so that we're not
551551
// covering up subtle bugs of IDs being reused.
552552
if COUNTER == ::u64::MAX {
553+
GUARD.unlock();
553554
panic!("failed to generate unique thread ID: bitspace exhausted");
554555
}
555556

0 commit comments

Comments
 (0)