Beispiel #1
0
        public void AtomicBoolean_Load_Should_Fail()
        {
            var atomicBoolean = new AtomicBoolean(true);

            Assert.Throws <InvalidOperationException>(() => atomicBoolean.Load(MemoryOrder.Release));
            Assert.Throws <NotSupportedException>(() => atomicBoolean.Load(MemoryOrder.Consume));
        }
 public void AtomicBoolean_Load_Should_Success()
 {
     var atomicBoolean = new AtomicBoolean(true);
     Assert.Equal(true, atomicBoolean.Load(MemoryOrder.Relaxed));
     Assert.Equal(true, atomicBoolean.Load(MemoryOrder.Acquire));
     Assert.Equal(true, atomicBoolean.Load(MemoryOrder.AcqRel));
     Assert.Equal(true, atomicBoolean.Load(MemoryOrder.SeqCst));
 }
Beispiel #3
0
        public void AtomicBoolean_Load_Should_Success()
        {
            var atomicBoolean = new AtomicBoolean(true);

            Assert.Equal(true, atomicBoolean.Load(MemoryOrder.Relaxed));
            Assert.Equal(true, atomicBoolean.Load(MemoryOrder.Acquire));
            Assert.Equal(true, atomicBoolean.Load(MemoryOrder.AcqRel));
            Assert.Equal(true, atomicBoolean.Load(MemoryOrder.SeqCst));
        }
 public void AtomicBoolean_Load_Should_Fail()
 {
     var atomicBoolean = new AtomicBoolean(true);
     Assert.Throws<InvalidOperationException>(() => atomicBoolean.Load(MemoryOrder.Release));
     Assert.Throws<NotSupportedException>(() => atomicBoolean.Load(MemoryOrder.Consume));
 }