Skip to content

Commit

Permalink
expt: fix #293
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Sep 27, 2021
1 parent 84107ff commit 81087ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/alibaba/ttl/TransmittableThreadLocal.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ private void removeThisFromHolder() {
}

private static void doExecuteCallback(boolean isBefore) {
for (TransmittableThreadLocal<Object> threadLocal : holder.get().keySet()) {
WeakHashMap<TransmittableThreadLocal<Object>, ?> ttlInstances = new WeakHashMap<TransmittableThreadLocal<Object>, Object>(holder.get());
for (TransmittableThreadLocal<Object> threadLocal : ttlInstances.keySet()) {
try {
if (isBefore) threadLocal.beforeExecute();
else threadLocal.afterExecute();
Expand Down

0 comments on commit 81087ce

Please sign in to comment.