chaokunyang commented on code in PR #2852:
URL: https://github.com/apache/fory/pull/2852#discussion_r2476317298
##########
java/fory-core/src/main/java/org/apache/fory/ThreadLocalFory.java:
##########
@@ -78,10 +81,12 @@ public ThreadLocalFory(Function<ClassLoader, Fory>
foryFactory) {
@Internal
@Override
public void registerCallback(Consumer<Fory> callback) {
- factoryCallback = factoryCallback.andThen(callback);
- for (LoaderBinding binding : allFory.keySet()) {
- binding.visitAllFory(callback);
- binding.setBindingCallback(factoryCallback);
+ synchronized (callbackLock) {
Review Comment:
could we also add lock to `ThreadPoolFory`? Or would it be possible to add
lock in `AbstactThreadSafeFory`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]