OpenStory.Common.AtomicBoolean.Set C# (CSharp) Method

Set() public method

Sets the value of the AtomicBoolean to the provided value.
public Set ( bool newValue ) : void
newValue bool The new value to assign.
return void
        public void Set(bool newValue)
        {
            int newValueAsInt = Convert.ToInt32(newValue);
            Interlocked.Exchange(ref this.value, newValueAsInt);
        }

Usage Example

Exemplo n.º 1
0
        public void Set_Should_Set_New_Value()
        {
            var b = new AtomicBoolean(false);

            b.Set(true);

            b.Value.Should().BeTrue();
        }