Made UnitSemaphoreAccessLock use a while loop to check condition

This commit is contained in:
Risto Lahtela 2021-02-12 09:39:29 +02:00
parent c0a210956d
commit 36ff87abf2
2 changed files with 2 additions and 4 deletions

View File

@ -80,11 +80,9 @@ public class GraphsJSONResolver implements Resolver {
DataID dataID = getDataID(type);
JSONStorage.StoredJSON graphJSON = getGraphJSON(request, dataID);
return Response.builder()
.setMimeType(MimeType.JSON)
.setJSONContent(graphJSON.json)
.setJSONContent(getGraphJSON(request, dataID).json)
.build();
}

View File

@ -36,7 +36,7 @@ public class UnitSemaphoreAccessLock {
public void enter() {
try {
synchronized (lockObject) {
if (accessing.get()) {
while (accessing.get()) {
lockObject.wait();
}
accessing.set(true);