Example usage for java.util.concurrent.locks ReentrantReadWriteLock writeLock

List of usage examples for java.util.concurrent.locks ReentrantReadWriteLock writeLock

Introduction

In this page you can find the example usage for java.util.concurrent.locks ReentrantReadWriteLock writeLock.

Prototype

public ReentrantReadWriteLock.WriteLock writeLock() 

Source Link

Usage

From source file:org.pentaho.di.trans.step.BaseStep.java

/**
 * Adds the result file.//from ww  w  .j a v  a  2s  .  c  o  m
 *
 * @param resultFile the result file
 */
public void addResultFile(ResultFile resultFile) {
    ReentrantReadWriteLock.WriteLock lock = resultFilesLock.writeLock();
    lock.lock();
    try {
        resultFiles.put(resultFile.getFile().toString(), resultFile);
    } finally {
        lock.unlock();
    }
}