Sendbird Chat SDK for .NET  3.0.29
SendBird.AtomicBoolean Class Reference

Public Member Functions

 AtomicBoolean ()
 Creates a new AtomicBoolean instance with an initial value of false. More...
 
 AtomicBoolean (bool value)
 Creates a new AtomicBoolean instance with the initial value provided. More...
 
bool Get ()
 This method returns the current value. More...
 
void Set (bool value)
 This method sets the current value atomically. More...
 
bool GetAndSet (bool value)
 This method atomically sets the value and returns the original value. More...
 
bool CompareAndSet (bool expected, bool result)
 Atomically sets the value to the given updated value if the current value == the expected value. More...
 

Static Public Member Functions

static implicit operator bool (AtomicBoolean value)
 This operator allows an implicit cast from AtomicBoolean to int. More...
 

Constructor & Destructor Documentation

◆ AtomicBoolean() [1/2]

SendBird.AtomicBoolean.AtomicBoolean ( )
inline

Creates a new AtomicBoolean instance with an initial value of false.

◆ AtomicBoolean() [2/2]

SendBird.AtomicBoolean.AtomicBoolean ( bool  value)
inline

Creates a new AtomicBoolean instance with the initial value provided.

Member Function Documentation

◆ CompareAndSet()

bool SendBird.AtomicBoolean.CompareAndSet ( bool  expected,
bool  result 
)
inline

Atomically sets the value to the given updated value if the current value == the expected value.

Parameters
expectedThe value to compare against.
resultThe value to set if the value is equal to the expected value.
Returns
true if the comparison and set was successful. A false indicates the comparison failed.

◆ Get()

bool SendBird.AtomicBoolean.Get ( )
inline

This method returns the current value.

Returns
The bool value to be accessed atomically.

◆ GetAndSet()

bool SendBird.AtomicBoolean.GetAndSet ( bool  value)
inline

This method atomically sets the value and returns the original value.

Parameters
valueThe new value.
Returns
The value before setting to the new value.

◆ operator bool()

static implicit SendBird.AtomicBoolean.operator bool ( AtomicBoolean  value)
inlinestatic

This operator allows an implicit cast from AtomicBoolean to int.

◆ Set()

void SendBird.AtomicBoolean.Set ( bool  value)
inline

This method sets the current value atomically.

Parameters
valueThe new value to set.

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