Unlock guard before overflow panic

This commit is contained in:
Stephen M. Coakley 2016-10-07 17:45:04 -05:00
parent e80fd2531b
commit 032bffa5b8
No known key found for this signature in database
GPG Key ID: 91B59C18494C4FC0

@ -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");
}