BAEL-3855

This commit is contained in:
Unknown
2020-03-15 13:04:55 +01:00
parent 34bfe41cd9
commit 22b51db880
2 changed files with 4 additions and 8 deletions

View File

@@ -16,11 +16,10 @@ public class SingleLock extends ConcurrentAccessExperiment {
return (()-> {
try {
lock.lock();
map.put("key" + key, "value" + key);
return map.put("key" + key, "value" + key);
} finally {
lock.unlock();
}
return null;
});
}
@@ -28,11 +27,10 @@ public class SingleLock extends ConcurrentAccessExperiment {
return (()-> {
try {
lock.lock();
map.get("key" + key);
return map.get("key" + key);
} finally {
lock.unlock();
}
return null;
});
}
}

View File

@@ -19,11 +19,10 @@ public class StripedLock extends ConcurrentAccessExperiment {
Lock lock = stripedLock.get(bucket);
try {
lock.lock();
map.put("key" + key, "value" + key);
return map.put("key" + key, "value" + key);
} finally {
lock.unlock();
}
return null;
});
}
@@ -33,11 +32,10 @@ public class StripedLock extends ConcurrentAccessExperiment {
Lock lock = stripedLock.get(bucket);
try {
lock.lock();
map.get("key" + key);
return map.get("key" + key);
} finally {
lock.unlock();
}
return null;
});
}
}