git://git.nikiroo.be
/
fanfix-swing.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac345e4
)
CacheLib: better lock
author
Niki Roo
<niki@nikiroo.be>
Fri, 1 May 2020 11:17:39 +0000
(13:17 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Fri, 1 May 2020 11:17:39 +0000
(13:17 +0200)
src/be/nikiroo/fanfix/library/CacheLibrary.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/fanfix/library/CacheLibrary.java
b/src/be/nikiroo/fanfix/library/CacheLibrary.java
index 92e4ae7a9951ec9715dc5faa9271bae362412dbf..a3c3b5e3b7bb6f5a61962e8837158e28692feb56 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/CacheLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/CacheLibrary.java
@@
-67,6
+67,7
@@
public class CacheLibrary extends BasicLibrary {
pg = new Progress();
}
+ List<MetaData> copy;
synchronized (metasLock) {
// We make sure that cached metas have precedence
if (metasMixed == null) {
@@
-86,10
+87,12
@@
public class CacheLibrary extends BasicLibrary {
}
}
}
+
+ copy = new ArrayList<MetaData>(metasMixed);
}
pg.done();
- return
new ArrayList<MetaData>(metasMixed)
;
+ return
copy
;
}
@Override
@@
-404,9
+407,7
@@
public class CacheLibrary extends BasicLibrary {
MetaData meta = lib.imprt(url, pgImprt);
updateMetaCache(metasReal, meta);
- synchronized (metasLock) {
- metasMixed = null;
- }
+ metasMixed = null;
clearFromCache(meta.getLuid());