Skip to content

Commit 5a27544

Browse files
committed
Apply ThreadLocal#remove() to pre-instantiation threads
See gh-13410 See gh-32874
1 parent 27985b1 commit 5a27544

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ public void preInstantiateSingletons() throws BeansException {
10301030
}
10311031
}
10321032
finally {
1033-
this.preInstantiationThread.set(null);
1033+
this.preInstantiationThread.remove();
10341034
}
10351035
if (!futures.isEmpty()) {
10361036
try {
@@ -1100,7 +1100,7 @@ private void instantiateSingletonInBackgroundThread(String beanName) {
11001100
throw ex;
11011101
}
11021102
finally {
1103-
this.preInstantiationThread.set(null);
1103+
this.preInstantiationThread.remove();
11041104
}
11051105
}
11061106

0 commit comments

Comments
 (0)