Exchange() public method

public Exchange ( bool newVal ) : bool
newVal bool
return bool
コード例 #1
0
 public void Exchange()
 {
     AtomicBoolean ai = new AtomicBoolean( true );
     Assert.AreEqual(true, ai.Exchange(false));
     Assert.AreEqual(false, ai.Exchange(false));
     Assert.AreEqual(false, ai.Exchange(true));
     Assert.AreEqual( true, ai.Value );
 }