All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.java.truevfs.kernel.impl.LockAspect.scala Maven / Gradle / Ivy

Go to download

Implements the API for accessing the federated virtual file system space. This reference implementation can get overridden by providing another file system manager factory implementation with a higher priority on the class path.

There is a newer version: 0.14.0
Show newest version
/*
 * Copyright (C) 2005-2012 Schlichtherle IT Services.
 * All rights reserved. Use is subject to license terms.
 */
package net.java.truevfs.kernel.impl

import java.util.concurrent.locks._
import javax.annotation.concurrent._

/** A mixin which provides some features of its associated reentrant `lock`.
  *
  * @author Christian Schlichtherle
  */
@ThreadSafe
private trait LockAspect[+L <: Lock] {

  /** The lock with the features to provide as an aspect. */
  def lock: L

  /** Runs the given operation while the lock is held. */
  final def locked[V] = LockOn[V](lock)_
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy