deadlock-fix
authorNiki Roo <niki@nikiroo.be>
Sat, 25 Apr 2020 19:02:36 +0000 (21:02 +0200)
committerNiki Roo <niki@nikiroo.be>
Sat, 25 Apr 2020 19:02:36 +0000 (21:02 +0200)
library/LocalLibrary.java

index 3cf5a25bc232baddd6ed34df9faabbaa3d82281f..aec89721753252783a6b3f9c3468e4afd4b7f9d1 100644 (file)
@@ -637,10 +637,13 @@ public class LocalLibrary extends BasicLibrary {
                }
 
                Map<MetaData, File[]> stories = this.stories;
-               synchronized (lock) {
-                       if (stories == null) {
-                               stories = getStoriesDo(pg);
-                               this.stories = stories;
+               if (stories == null) {
+                       stories = getStoriesDo(pg);
+                       synchronized (lock) {
+                               if (this.stories == null)
+                                       this.stories = stories;
+                               else
+                                       stories = this.stories;
                        }
                }