예제 #1
0
 private static ref int Reinterpret(ref SeqNum location)
 {
     return(ref Unsafe.As <SeqNum, int>(ref location));
 }
예제 #2
0
 public static SeqNum CompareExchange(ref SeqNum location, SeqNum value, SeqNum comparand)
 {
     return((SeqNum)Interlocked.CompareExchange(ref Reinterpret(ref location), value.RawValue, comparand.RawValue));
 }
예제 #3
0
 public static SeqNum Decrement(ref SeqNum location)
 {
     return((SeqNum)Interlocked.Decrement(ref Reinterpret(ref location)));
 }
예제 #4
0
 public static SeqNum Exchange(ref SeqNum location, SeqNum value)
 {
     return((SeqNum)Interlocked.Exchange(ref Reinterpret(ref location), value.RawValue));
 }
예제 #5
0
 public static SeqNum Add(ref SeqNum location, int value)
 {
     return((SeqNum)Interlocked.Add(ref Reinterpret(ref location), value));
 }