public class StripedExt extends Object
Stripedto support creating fair reentrant locks. We use reflection to invoke
com.google.common.util.concurrent.Striped.CompactStriped#CompactStriped(int, Supplier)and provide a supplier that creates a fair lock. This is clearly a hack, but seems better than the alternative of A) trying to find another library that supports this or B) re-implementing striped locking ourselves. Guava Feature Request: https://github.com/google/guava/issues/2514
|Constructor and Description|
|Modifier and Type||Method and Description|
public static com.google.common.util.concurrent.Striped<Lock> fairLock(int stripes)
Striped<Lock>with eagerly initialized, strongly referenced locks. Every lock is fair and reentrant.
stripes- the minimum number of stripes (locks) required
Copyright © 2020. All rights reserved.