We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 619c27a commit 2750d3aCopy full SHA for 2750d3a
library/std/src/thread/mod.rs
@@ -1004,6 +1004,7 @@ impl ThreadId {
1004
// If we somehow use up all our bits, panic so that we're not
1005
// covering up subtle bugs of IDs being reused.
1006
if COUNTER == u64::MAX {
1007
+ drop(_guard); // in case the panic handler ends up calling `ThreadId::new()`, avoid reentrant lock acquire.
1008
panic!("failed to generate unique thread ID: bitspace exhausted");
1009
}
1010
0 commit comments