Ensure sequential execution of configuration writer threads (#516)
* Ensure sequential execution of configuration writer threads Signed-off-by: Chang Feng <chang_196700@hotmail.com> * Change method to add synchronized to action Signed-off-by: Chang Feng <chang_196700@hotmail.com>
This commit is contained in:
@@ -33,7 +33,9 @@ public class InvocationDispatcher<ARG> implements Consumer<ARG> {
|
|||||||
|
|
||||||
public static <ARG> InvocationDispatcher<ARG> runOn(Consumer<Runnable> executor, Consumer<ARG> action) {
|
public static <ARG> InvocationDispatcher<ARG> runOn(Consumer<Runnable> executor, Consumer<ARG> action) {
|
||||||
return new InvocationDispatcher<>(arg -> executor.accept(() -> {
|
return new InvocationDispatcher<>(arg -> executor.accept(() -> {
|
||||||
action.accept(arg.get());
|
synchronized (action) {
|
||||||
|
action.accept(arg.get());
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user