mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 20:13:52 +00:00
Merge branch 'master' into foiling
This commit is contained in:
commit
bb3438d208
7 files changed
+104
-54
No files matched your search
@@ -34,28 +34,9 @@ class MediaLibrary {
|
||||
* result in case a MediaTrack is being removed from the library or changes values such that it needs to be removed
|
||||
* from the cache.
|
||||
*/
|
||||
|
||||
private final ConcurrentMap<RegattaAndRaceIdentifier, Set<MediaTrack>> mediaTracksByRace = new ConcurrentHashMap<RegattaAndRaceIdentifier, Set<MediaTrack>>();
|
||||
|
||||
private final NamedReentrantReadWriteLock lock = new NamedReentrantReadWriteLock(MediaLibrary.class.getName(), /* fair */
|
||||
false);
|
||||
|
||||
// /**
|
||||
// * Sort in reverse order of start time! For equal start times compare dbId to distinguish different instances.
|
||||
// */
|
||||
// private static final Comparator<MediaTrack> COMPARATOR_BY_REVERSE_STARTTIME = new Comparator<MediaTrack>() {
|
||||
//
|
||||
// @Override
|
||||
// public int compare(MediaTrack mediaTrack1, MediaTrack mediaTrack2) {
|
||||
// int result = compareDatesAllowingNull(mediaTrack2.startTime, mediaTrack1.startTime);
|
||||
// if (result == 0) {
|
||||
// return mediaTrack1.dbId.compareTo(mediaTrack2.dbId);
|
||||
// } else {
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// };
|
||||
private final NamedReentrantReadWriteLock lock = new NamedReentrantReadWriteLock(MediaLibrary.class.getName(), /* fair */ false);
|
||||
|
||||
/**
|
||||
* NOTE: The implementation of this lookup using simple linear search is a trade off between development effort and
|
||||
@@ -74,7 +55,6 @@ class MediaLibrary {
|
||||
*
|
||||
*/
|
||||
Collection<MediaTrack> findMediaTracksForRace(RegattaAndRaceIdentifier race) {
|
||||
|
||||
if (race != null) {
|
||||
LockUtil.lockForRead(lock);
|
||||
try {
|
||||
@@ -87,7 +67,6 @@ class MediaLibrary {
|
||||
} finally {
|
||||
LockUtil.unlockAfterRead(lock);
|
||||
}
|
||||
|
||||
}
|
||||
// else
|
||||
return Collections.emptySet();
|
||||
|
||||
Reference in new issue
Block a user