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