C# Class Akka.Util.AtomicBoolean

Implementation of the java.concurrent.util.AtomicBoolean type. Uses Interlocked.MemoryBarrier internally to enforce ordering of writes without any explicit locking. .NET's strong memory on write guarantees might already enforce this ordering, but the addition of the MemoryBarrier guarantees it.
Show file Open project: rogeralsing/akka.net Class Usage Examples

Public Methods

Method Description
AtomicBoolean ( bool initialValue = false ) : System.Threading

Sets the initial value of this AtomicBoolean to initialValue.

CompareAndSet ( bool expected, bool newValue ) : bool

If Value equals expected, then set the Value to newValue.

Method Details

AtomicBoolean() public method

Sets the initial value of this AtomicBoolean to initialValue.
public AtomicBoolean ( bool initialValue = false ) : System.Threading
initialValue bool
return System.Threading

CompareAndSet() public method

If Value equals expected, then set the Value to newValue.
public CompareAndSet ( bool expected, bool newValue ) : bool
expected bool
newValue bool
return bool