Java Code Examples for com.google.common.util.concurrent.Striped#lock()

The following examples show how to use com.google.common.util.concurrent.Striped#lock() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KeyLock.java    From hugegraph-common with Apache License 2.0 4 votes vote down vote up
public KeyLock(int size) {
    this.locks = Striped.lock(size);
}
 
Example 2
Source File: StripedLock.java    From tutorials with MIT License 4 votes vote down vote up
public StripedLock(int buckets) {
    stripedLock = Striped.lock(buckets);
}