Apply ThreadLocal#remove() to pre-instantiation threads

See gh-13410
See gh-32874
This commit is contained in:
Juergen Hoeller
2024-05-28 16:35:58 +02:00
parent 27985b1439
commit 5a275443b5

View File

@@ -1030,7 +1030,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
}
}
finally {
this.preInstantiationThread.set(null);
this.preInstantiationThread.remove();
}
if (!futures.isEmpty()) {
try {
@@ -1100,7 +1100,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
throw ex;
}
finally {
this.preInstantiationThread.set(null);
this.preInstantiationThread.remove();
}
}