Proton DotNet
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Properties | List of all members
Apache.Qpid.Proton.Client.Concurrent.AtomicLong Class Reference

Simple Atomic abstraction around the long type to make atomic operations on long types simpler to manage in code. The default value of this type is zero. More...

Public Member Functions

 AtomicLong (long initialValue=0)
 Create a new instance with the given value or default to zero.
 
bool CompareAndSet (long expect, long update)
 Atomically sets the value to the new one if the current value == expected.
 
long IncrementAndGet ()
 Atomically increments the current value.
 
long DecrementAndGet ()
 Atomically decrements the current value.
 
long Get ()
 Reads the value of the long atomically and returns it.
 
void Set (long newValue)
 Performs an atomic write of the long value.
 

Static Public Member Functions

static implicit operator long (AtomicLong atomicLong)
 

Properties

long Value [get]
 Read the value of the long atomically and return it.
 

Detailed Description

Simple Atomic abstraction around the long type to make atomic operations on long types simpler to manage in code. The default value of this type is zero.

Constructor & Destructor Documentation

◆ AtomicLong()

Apache.Qpid.Proton.Client.Concurrent.AtomicLong.AtomicLong ( long  initialValue = 0)
inline

Create a new instance with the given value or default to zero.

Parameters
initialValueInitial value for the long

Member Function Documentation

◆ CompareAndSet()

bool Apache.Qpid.Proton.Client.Concurrent.AtomicLong.CompareAndSet ( long  expect,
long  update 
)
inline

Atomically sets the value to the new one if the current value == expected.

Parameters
expectThe value that is expected
updateThe value to assign if the expectation is met.
Returns

◆ DecrementAndGet()

long Apache.Qpid.Proton.Client.Concurrent.AtomicLong.DecrementAndGet ( )
inline

Atomically decrements the current value.

Returns
The decremented value

◆ Get()

long Apache.Qpid.Proton.Client.Concurrent.AtomicLong.Get ( )
inline

Reads the value of the long atomically and returns it.

Returns
The value of the long

◆ IncrementAndGet()

long Apache.Qpid.Proton.Client.Concurrent.AtomicLong.IncrementAndGet ( )
inline

Atomically increments the current value.

Returns
The incremented value

◆ Set()

void Apache.Qpid.Proton.Client.Concurrent.AtomicLong.Set ( long  newValue)
inline

Performs an atomic write of the long value.

Parameters
newValueThe new value to assign to the long

The documentation for this class was generated from the following file: