Unlock guard before overflow panic
This commit is contained in:
@@ -550,6 +550,7 @@ impl ThreadId {
|
|||||||
// If we somehow use up all our bits, panic so that we're not
|
// If we somehow use up all our bits, panic so that we're not
|
||||||
// covering up subtle bugs of IDs being reused.
|
// covering up subtle bugs of IDs being reused.
|
||||||
if COUNTER == ::u64::MAX {
|
if COUNTER == ::u64::MAX {
|
||||||
|
GUARD.unlock();
|
||||||
panic!("failed to generate unique thread ID: bitspace exhausted");
|
panic!("failed to generate unique thread ID: bitspace exhausted");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user