
scala.concurrent.stm.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-stm_3.0.0-M2 Show documentation
Show all versions of scala-stm_3.0.0-M2 Show documentation
A library for Software Transactional Memory in Scala
The newest version!
/* scala-stm - (c) 2009-2012, Stanford University, PPL */
package scala.concurrent
import java.util.concurrent.TimeUnit
import scala.language.implicitConversions
package object stm {
/** Atomically executes atomic blocks using the default `TxnExecutor`. See
* `TxnExecutor.apply`.
*/
def atomic: scala.concurrent.stm.TxnExecutor = scala.concurrent.stm.TxnExecutor.defaultAtomic
/** Equivalent to `Txn.retry`. */
def retry(implicit txn: scala.concurrent.stm.InTxn): Nothing = scala.concurrent.stm.Txn.retry
/** Equivalent to `Txn.retryFor(timeout, unit)`. */
def retryFor(timeout: Long, unit: TimeUnit = TimeUnit.MILLISECONDS)(implicit txn: scala.concurrent.stm.InTxn): Unit =
scala.concurrent.stm.Txn.retryFor(timeout, unit)
/** This is the first half of the machinery for implementing `orAtomic`. */
implicit def wrapChainedAtomic[A](lhs: => A): PendingAtomicBlock[A] = new PendingAtomicBlock(lhs)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy