Represents atomic boolean.
Namespace: DotNext.Threading Assembly: DotNext.dll Syntaxpublic struct Atomic.Boolean : IEquatable<bool>
Constructors | Edit this page View Source Boolean(bool)
Represents atomic boolean.
Declarationpublic Boolean(bool value)
Parameters Type Name Description bool value
Initial value of the atomic boolean.
Properties | Edit this page View Source ValueGets or sets boolean value in volatile manner.
Declarationpublic bool Value { readonly get; set; }
Property Value Methods | Edit this page View Source AccumulateAndGet(bool, Func<bool, bool, bool>)
Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value.
Declarationpublic bool AccumulateAndGet(bool x, Func<bool, bool, bool> accumulator)
Parameters Type Name Description bool x
Accumulator operand.
Func<bool, bool, bool> accumulatorA side-effect-free function of two arguments.
Returns Type Description boolThe updated value.
Remarks | Edit this page View Source AccumulateAndGet<TAccumulator>(bool, TAccumulator)Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value.
Declarationpublic bool AccumulateAndGet<TAccumulator>(bool x, TAccumulator accumulator) where TAccumulator : ISupplier<bool, bool, bool>
Parameters Type Name Description bool x
Accumulator operand.
TAccumulator accumulatorA side-effect-free function of two arguments.
Returns Type Description boolThe updated value.
Type Parameters Name Description TAccumulatorThe type implementing accumulator.
Remarks | Edit this page View Source CompareAndSet(bool, bool)Atomically sets referenced value to the given updated value if the current value == the expected value.
Declarationpublic bool CompareAndSet(bool expected, bool update)
Parameters Type Name Description bool expected
The expected value.
bool updateThe new value.
Returns Type Description booltrue if successful. false return indicates that the actual value was not equal to the expected value.
| Edit this page View Source CompareExchange(bool, bool)Atomically sets referenced value to the given updated value if the current value == the expected value.
Declarationpublic bool CompareExchange(bool update, bool expected)
Parameters Type Name Description bool update
The new value.
bool expectedThe expected value.
Returns Type Description boolThe original value.
| Edit this page View Source Equals(bool)Determines whether stored value is equal to value passed as argument.
Declarationpublic readonly bool Equals(bool other)
Parameters Type Name Description bool other
Other value to compare.
Returns Type Description booltrue, if stored value is equal to other value; otherwise, false.
| Edit this page View Source Equals(object?)Determines whether stored value is equal to value as the passed argument.
Declarationpublic override readonly bool Equals(object? other)
Parameters Type Name Description object other
Other value to compare.
Returns Type Description booltrue, if stored value is equal to other value; otherwise, false.
Overrides | Edit this page View Source FalseToTrue()Atomically sets true value if the current value is false.
Declarationpublic bool FalseToTrue()
Returns Type Description bool
true if current value is modified successfully; otherwise, false.
| Edit this page View Source GetAndAccumulate(bool, Func<bool, bool, bool>)Atomically updates the current value with the results of applying the given function to the current and given values, returning the original value.
Declarationpublic bool GetAndAccumulate(bool x, Func<bool, bool, bool> accumulator)
Parameters Type Name Description bool x
Accumulator operand.
Func<bool, bool, bool> accumulatorA side-effect-free function of two arguments.
Returns Type Description boolThe original value.
Remarks | Edit this page View Source GetAndAccumulate<TAccumulator>(bool, TAccumulator)Atomically updates the current value with the results of applying the given function to the current and given values, returning the original value.
Declarationpublic bool GetAndAccumulate<TAccumulator>(bool x, TAccumulator accumulator) where TAccumulator : ISupplier<bool, bool, bool>
Parameters Type Name Description bool x
Accumulator operand.
TAccumulator accumulatorA side-effect-free function of two arguments.
Returns Type Description boolThe original value.
Type Parameters Name Description TAccumulatorThe type implementing accumulator.
Remarks | Edit this page View Source GetAndNegate()Negates currently stored value atomically.
Declarationpublic bool GetAndNegate()
Returns Type Description bool
The original value before negation.
| Edit this page View Source GetAndSet(bool)Modifies the current value atomically.
Declarationpublic bool GetAndSet(bool update)
Parameters Type Name Description bool update
A new value to be stored into this container.
Returns Type Description boolOriginal value before modification.
| Edit this page View Source GetAndUpdate(Func<bool, bool>)Atomically updates the stored value with the results of applying the given function, returning the original value.
Declarationpublic bool GetAndUpdate(Func<bool, bool> updater)
Parameters Type Name Description Func<bool, bool> updater
A side-effect-free function.
Returns Type Description boolThe original value.
| Edit this page View Source GetAndUpdate<TUpdater>(TUpdater)Atomically updates the stored value with the results of applying the given function, returning the original value.
Declarationpublic bool GetAndUpdate<TUpdater>(TUpdater updater) where TUpdater : ISupplier<bool, bool>
Parameters Type Name Description TUpdater updater
A side-effect-free function.
Returns Type Description boolThe original value.
Type Parameters Name Description TUpdaterThe type implementing updater.
| Edit this page View Source GetHashCode()Computes hash code for the stored value.
Declarationpublic override readonly int GetHashCode()
Returns Type Description int
The hash code of the stored boolean value.
Overrides | Edit this page View Source NegateAndGet()Negates currently stored value atomically.
Declarationpublic bool NegateAndGet()
Returns Type Description bool
Negation result.
| Edit this page View Source SetAndGet(bool)Modifies the current value atomically.
Declarationpublic bool SetAndGet(bool update)
Parameters Type Name Description bool update
A new value to be stored into this container.
Returns Type Description boolA new value passed as argument.
| Edit this page View Source ToString()Returns stored boolean value in the form of string.
Declarationpublic override readonly string ToString()
Returns Type Description string
Textual representation of stored boolean value.
Overrides | Edit this page View Source TrueToFalse()Atomically sets false value if the current value is true.
Declarationpublic bool TrueToFalse()
Returns Type Description bool
true if current value is modified successfully; otherwise, false.
| Edit this page View Source UpdateAndGet(Func<bool, bool>)Atomically updates the stored value with the results of applying the given function, returning the updated value.
Declarationpublic bool UpdateAndGet(Func<bool, bool> updater)
Parameters Type Name Description Func<bool, bool> updater
A side-effect-free function.
Returns Type Description boolThe updated value.
| Edit this page View Source UpdateAndGet<TUpdater>(TUpdater)Atomically updates the stored value with the results of applying the given function, returning the updated value.
Declarationpublic bool UpdateAndGet<TUpdater>(TUpdater updater) where TUpdater : ISupplier<bool, bool>
Parameters Type Name Description TUpdater updater
A side-effect-free function.
Returns Type Description boolThe updated value.
Type Parameters Name Description TUpdaterThe type implementing updater.
Implements Extension MethodsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4