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

cgta.oscala.util.OLock.scala Maven / Gradle / Ivy

The newest version!
package cgta.oscala
package util


//////////////////////////////////////////////////////////////
// Created by bjackman @ 4/27/14 8:25 PM
//////////////////////////////////////////////////////////////

object OLock {
  def apply() : OLock = new OLockImpl
}

trait OLock {
  def lock()
  def unlock()
  def using[A](f : => A) : A = {
    lock()
    try {
      f
    } finally {
      unlock()
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy