about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorStephen M. Coakley <me@stephencoakley.com>2016-10-07 17:45:04 -0500
committerStephen M. Coakley <me@stephencoakley.com>2016-10-07 17:45:04 -0500
commit032bffa5b8ae6c3977884c4e10fd6ab6a5dc5ef6 (patch)
tree2ed99d8856dd301e348ee75fbe26f30bf987d983 /src/libstd/thread
parente80fd2531bbb8d2ca30e4036d7be5bcfcaefb6c0 (diff)
downloadrust-032bffa5b8ae6c3977884c4e10fd6ab6a5dc5ef6.tar.gz
rust-032bffa5b8ae6c3977884c4e10fd6ab6a5dc5ef6.zip
Unlock guard before overflow panic
Diffstat (limited to 'src/libstd/thread')
-rw-r--r--src/libstd/thread/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index c8b6046bb8d..98feea96f8c 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -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");
             }