BAEL-3855

This commit is contained in:
Unknown 2020-03-11 20:09:14 +01:00
parent e09d87a604
commit e501b2092f
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ public class SingleLock extends ConcurrentAccessExperiment {
lock = new ReentrantLock();
}
protected synchronized Supplier<?> putSupplier(Map<String,String> map, int key) {
protected Supplier<?> putSupplier(Map<String,String> map, int key) {
return (()-> {
try {
lock.lock();
@ -27,7 +27,7 @@ public class SingleLock extends ConcurrentAccessExperiment {
});
}
protected synchronized Supplier<?> getSupplier(Map<String,String> map, int key) {
protected Supplier<?> getSupplier(Map<String,String> map, int key) {
return (()-> {
try {
lock.lock();

View File

@ -13,7 +13,7 @@ public class StripedLock extends ConcurrentAccessExperiment {
stripedLock = Striped.lock(buckets);
}
protected synchronized Supplier<?> putSupplier(Map<String,String> map, int key) {
protected Supplier<?> putSupplier(Map<String,String> map, int key) {
return (()-> {
int bucket = key % stripedLock.size();
Lock lock = stripedLock.get(bucket);
@ -31,7 +31,7 @@ public class StripedLock extends ConcurrentAccessExperiment {
});
}
protected synchronized Supplier<?> getSupplier(Map<String,String> map, int key) {
protected Supplier<?> getSupplier(Map<String,String> map, int key) {
return (()-> {
int bucket = key % stripedLock.size();
Lock lock = stripedLock.get(bucket);