This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git


The following commit(s) were added to refs/heads/main by this push:
     new 50f5d4d4c fix: Fix the issue of addListener not releasing the lock 
(#2500)
50f5d4d4c is described below

commit 50f5d4d4ceca0942af5f02328bf0db1b40362cb1
Author: opensnail <[email protected]>
AuthorDate: Sat Aug 23 12:11:55 2025 +0800

    fix: Fix the issue of addListener not releasing the lock (#2500)
    
    Co-authored-by: opensnail <[email protected]>
---
 .../src/main/java/org/apache/fory/resolver/AllowListChecker.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/java/fory-core/src/main/java/org/apache/fory/resolver/AllowListChecker.java 
b/java/fory-core/src/main/java/org/apache/fory/resolver/AllowListChecker.java
index 507c9522d..b49ded2e4 100644
--- 
a/java/fory-core/src/main/java/org/apache/fory/resolver/AllowListChecker.java
+++ 
b/java/fory-core/src/main/java/org/apache/fory/resolver/AllowListChecker.java
@@ -237,8 +237,9 @@ public class AllowListChecker implements ClassChecker {
   public void addListener(ClassResolver classResolver) {
     try {
       lock.writeLock().lock();
-    } finally {
       listeners.put(classResolver, true);
+    } finally {
+        lock.writeLock().unlock();
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to