lock

com.netflix.eureka.registry.AbstractInstanceRegistry 
public void register(InstanceInfo registrant, int leaseDuration, boolean isReplication)   191行
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
private final Lock read = readWriteLock.readLock();
try {
    read.lock();
  ....
} finally {
    read.unlock();
}
相關文章
相關標籤/搜索