Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,7 @@
* @author Dave Syer
* @author Jimmy Praet
* @author Mahmoud Ben Hassine
* @author Yanming Zhou
* @since 3.0
*/
public abstract class SynchronizationManagerSupport<E, C> {
Expand Down Expand Up @@ -87,11 +88,7 @@ public C register(@Nullable E execution) {
getCurrent().push(execution);
C context;
synchronized (contexts) {
context = contexts.get(execution);
if (context == null) {
context = createNewContext(execution);
contexts.put(execution, context);
}
context = contexts.computeIfAbsent(execution, this::createNewContext);
}
increment();
return context;
Expand Down Expand Up @@ -131,11 +128,7 @@ public void increment() {
if (current != null) {
AtomicInteger count;
synchronized (counts) {
count = counts.get(current);
if (count == null) {
count = new AtomicInteger();
counts.put(current, count);
}
count = counts.computeIfAbsent(current, k -> new AtomicInteger());
}
count.incrementAndGet();
}
Expand Down