fun <T> read(operation: Supplier<T>): T { return try { lock.readLock().lock() operation.get() } finally { lock.readLock().unlock() } }
Obtain a read lock , perform the operation , and release the read lock .