CommitBarrier

Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

sealed abstract class CancelCause

A class that describes the reason that a commit barrier member was not committed. Cancelled members might have been rolled back or might have been prevented from ever starting.

A class that describes the reason that a commit barrier member was not committed. Cancelled members might have been rolled back or might have been prevented from ever starting.

The CancelCause used when the addMember call that created a member was from inside a transaction that later rolled back. This cancel cause does not necessarily imply that other members of the commit barrier didn't (or won't) eventually succeed.

The CancelCause used when the addMember call that created a member was from inside a transaction that later rolled back. This cancel cause does not necessarily imply that other members of the commit barrier didn't (or won't) eventually succeed.

trait Member

A participant in a synchronized group commit. Each member of a commit barrier must arrange for either atomic or cancel to be called, otherwise the other members won't be able to commit.

A participant in a synchronized group commit. Each member of a commit barrier must arrange for either atomic or cancel to be called, otherwise the other members won't be able to commit.

case class MemberCycle(debugInfo: Any) extends CancelCause

The CancelCause used when some members of the commit barrier conflict with each other. Since the commit barrier can only succeed if all of them commit simultaneously this would lead to a deadlock, so the entire commit barrier is instead cancelled. This cancel cause implies that all members were eventually cancelled.

The CancelCause used when some members of the commit barrier conflict with each other. Since the commit barrier can only succeed if all of them commit simultaneously this would lead to a deadlock, so the entire commit barrier is instead cancelled. This cancel cause implies that all members were eventually cancelled.

debugInfo is optional information provided by the STM implementation to help locate the source of the avoided deadlock. If provided it might be one of the Refs in the cycle, or it might be a String describing the cycle.

case class MemberUncaughtExceptionCause(x: Throwable) extends CancelCause

The CancelCause used when a member of the commit barrier cannot commit due to an uncaught exception (see Txn.UncaughtExceptionCause). This cancel cause implies that all members of the commit barrier rolled back. The exception will be rethrown to the thread running the member that originally generated the exception, all other members will get this CancelCause.

The CancelCause used when a member of the commit barrier cannot commit due to an uncaught exception (see Txn.UncaughtExceptionCause). This cancel cause implies that all members of the commit barrier rolled back. The exception will be rethrown to the thread running the member that originally generated the exception, all other members will get this CancelCause.

This cancel cause will also be used if a member thread receives an interrupt while it is waiting for the commit barrier.

case object Timeout extends CancelCause

The CancelCause used when some members of the commit barrier did not finish in time. Members may finish either by completing or by being cancelled. This cancel cause implies that all members were eventually cancelled.

The CancelCause used when some members of the commit barrier did not finish in time. Members may finish either by completing or by being cancelled. This cancel cause implies that all members were eventually cancelled.

case class UserCancel(info: Any) extends CancelCause

A CancelCause provided for users of commit barriers, not used by the STM itself. This cancel cause does not imply that other members of the commit barrier didn't (or won't) eventually succeed.

A CancelCause provided for users of commit barriers, not used by the STM itself. This cancel cause does not imply that other members of the commit barrier didn't (or won't) eventually succeed.

Value members

Deprecated methods

@deprecated("The current CommitBarrier implementation doesn\'t have proper deadlock avoidance, please avoid if possible", "0.8")
def apply(timeout: Long, unit: TimeUnit): CommitBarrier

Constructs and returns a new CommitBarrier in which each member will wait at most timeout unit for other members of the barrier to become ready to commit. If timeout occurs all members will be cancelled with a CancelCause of Timeout. Each commit barrier may be used for at most one coordinated commit (it is not cyclic).

Constructs and returns a new CommitBarrier in which each member will wait at most timeout unit for other members of the barrier to become ready to commit. If timeout occurs all members will be cancelled with a CancelCause of Timeout. Each commit barrier may be used for at most one coordinated commit (it is not cyclic).

Deprecated