BAEL-3855
This commit is contained in:
parent
e09d87a604
commit
e501b2092f
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue