BAEL-3855
This commit is contained in:
parent
e09d87a604
commit
e501b2092f
@ -12,7 +12,7 @@ public class SingleLock extends ConcurrentAccessExperiment {
|
|||||||
lock = new ReentrantLock();
|
lock = new ReentrantLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized Supplier<?> putSupplier(Map<String,String> map, int key) {
|
protected Supplier<?> putSupplier(Map<String,String> map, int key) {
|
||||||
return (()-> {
|
return (()-> {
|
||||||
try {
|
try {
|
||||||
lock.lock();
|
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 (()-> {
|
return (()-> {
|
||||||
try {
|
try {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
|
@ -13,7 +13,7 @@ public class StripedLock extends ConcurrentAccessExperiment {
|
|||||||
stripedLock = Striped.lock(buckets);
|
stripedLock = Striped.lock(buckets);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized Supplier<?> putSupplier(Map<String,String> map, int key) {
|
protected Supplier<?> putSupplier(Map<String,String> map, int key) {
|
||||||
return (()-> {
|
return (()-> {
|
||||||
int bucket = key % stripedLock.size();
|
int bucket = key % stripedLock.size();
|
||||||
Lock lock = stripedLock.get(bucket);
|
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 (()-> {
|
return (()-> {
|
||||||
int bucket = key % stripedLock.size();
|
int bucket = key % stripedLock.size();
|
||||||
Lock lock = stripedLock.get(bucket);
|
Lock lock = stripedLock.get(bucket);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user