mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 15:57:11 +00:00
getTrackedRaces() now also checks for write lock count
This commit is contained in:
1 parent
00b4a76f1c
commit
11fd9f907d
1 file changed
+1
-1
+1
-1
@@ -168,7 +168,7 @@ public class TrackedRegattaImpl implements TrackedRegatta {
|
||||
|
||||
@Override
|
||||
public Iterable<? extends TrackedRace> getTrackedRaces() {
|
||||
if (trackedRacesLock.getReadHoldCount() <= 0) {
|
||||
if (trackedRacesLock.getReadHoldCount() <= 0 && trackedRacesLock.getWriteHoldCount() <= 0) {
|
||||
throw new IllegalStateException("Callers of TrackedRegatta.getTrackedRaces() must hold the read lock; see TrackedRegatta.lockTrackedRacesForRead()");
|
||||
}
|
||||
return trackedRaces.values();
|
||||
|
||||
Reference in new issue
Block a user