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

Provides a boolean value that may be updated and read atomically. More...

Public Member Functions

 AtomicBoolean (bool initialValue=false)
 Creates a new atomic boolean instance with either the given value or defaults to false.
 
bool CompareAndSet (bool expect, bool update)
 Atomically sets the value to the new one if the current value == expected.
 
bool Get ()
 Reads the value of the boolean atomically and returns it.
 
void Set (bool newValue)
 Performs an atomic write of the boolean value.
 

Static Public Member Functions

static implicit operator bool (AtomicBoolean atomicBool)
 
static implicit operator AtomicBoolean (bool value)
 

Properties

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

Detailed Description

Provides a boolean value that may be updated and read atomically.

Constructor & Destructor Documentation

◆ AtomicBoolean()

Apache.Qpid.Proton.Client.Concurrent.AtomicBoolean.AtomicBoolean ( bool  initialValue = false)
inline

Creates a new atomic boolean instance with either the given value or defaults to false.

Parameters
initialValueThe initial value to provide to the boolean

Member Function Documentation

◆ CompareAndSet()

bool Apache.Qpid.Proton.Client.Concurrent.AtomicBoolean.CompareAndSet ( bool  expect,
bool  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

◆ Get()

bool Apache.Qpid.Proton.Client.Concurrent.AtomicBoolean.Get ( )
inline

Reads the value of the boolean atomically and returns it.

Returns
The value of the boolean

◆ Set()

void Apache.Qpid.Proton.Client.Concurrent.AtomicBoolean.Set ( bool  newValue)
inline

Performs an atomic write of the boolean value.

Parameters
newValueThe new value to assign to the boolean

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