From dadd24a9dee823cade4dd1467f110749f9a4191b Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sat, 25 Apr 2020 21:02:36 +0200 Subject: [PATCH] deadlock-fix --- src/be/nikiroo/fanfix/library/LocalLibrary.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/be/nikiroo/fanfix/library/LocalLibrary.java b/src/be/nikiroo/fanfix/library/LocalLibrary.java index 3cf5a25b..aec89721 100644 --- a/src/be/nikiroo/fanfix/library/LocalLibrary.java +++ b/src/be/nikiroo/fanfix/library/LocalLibrary.java @@ -637,10 +637,13 @@ public class LocalLibrary extends BasicLibrary { } Map 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; } } -- 2.27.0