C# Class clojure.lang.LockingTransaction

Provides transaction semantics for Agents, Refs, etc.
显示文件 Open project: richhickey/clojure-clr Class Usage Examples

Public Methods

Method Description
Abort ( ) : void

Kill this transaction.

GetEx ( ) : LockingTransaction

Get the transaction running on this thread (throw exception if no transaction).

GetReadPoint ( ) : void

Get a new read point value.

ReleaseIfEnsured ( Ref r ) : void
Stop ( int status ) : void

Stop this transaction.

TryWriteLock ( Ref r ) : void

Private Methods

Method Description
Barge ( Info refinfo ) : bool

Try to barge a conflicting transaction.

BargeTimeElapsed ( ) : bool

Determine if sufficient clock time has elapsed to barge another transaction.

BlockAndBail ( Info refinfo ) : object
ContainsNestedRetryEx ( Exception ex ) : bool

Determine if the exception wraps a RetryEx at some level.

Needed because sometimes our retry exceptions get wrapped. You do not want to know how long it took to track down this problem.

DoCommute ( Ref r, IFn fn, ISeq args ) : object

Post a commute on a ref in this transaction.

DoEnsure ( Ref r ) : void

Touch a ref. (Lock it.)

DoGet ( Ref r ) : object

Get the value of a ref most recently set in this transaction (or prior to entering).

DoSet ( Ref r, object val ) : object

Set the value of a ref inside the transaction.

Enqueue ( Agent action ) : void

Add an agent action sent during the transaction to a queue.

GetCommitPoint ( ) : long

Get a commit point value.

GetRunning ( ) : LockingTransaction

Get the transaction running on this thread (or null if no transaction).

Lock ( Ref r ) : object

Lock a ref.

Run ( IFn fn ) : object

Start a transaction and invoke a function.

isRunning ( ) : bool
runInTransaction ( IFn fn ) : object

Method Details

Abort() public method

Kill this transaction.
public Abort ( ) : void
return void

GetEx() public static method

Get the transaction running on this thread (throw exception if no transaction).
public static GetEx ( ) : LockingTransaction
return LockingTransaction

GetReadPoint() public method

Get a new read point value.
public GetReadPoint ( ) : void
return void

ReleaseIfEnsured() public method

public ReleaseIfEnsured ( Ref r ) : void
r Ref
return void

Stop() public method

Stop this transaction.
public Stop ( int status ) : void
status int The new status.
return void

TryWriteLock() public method

public TryWriteLock ( Ref r ) : void
r Ref
return void