System.Threading.AtomicBoolean.CompareAndExchange C# (CSharp) 메소드

CompareAndExchange() 공개 메소드

public CompareAndExchange ( bool expected, bool newVal ) : bool
expected bool
newVal bool
리턴 bool
		public bool CompareAndExchange (bool expected, bool newVal)
		{
			int newTemp = newVal ? Set : UnSet;
			int expectedTemp = expected ? Set : UnSet;

			return AotInterlocked.CompareExchange (ref flag, newTemp, expectedTemp) == expectedTemp;
		}