Beispiel #1
0
 private static ref int Reinterpret(ref SeqNum location)
 {
     return(ref Unsafe.As <SeqNum, int>(ref location));
 }
Beispiel #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));
 }
Beispiel #3
0
 public static SeqNum Decrement(ref SeqNum location)
 {
     return((SeqNum)Interlocked.Decrement(ref Reinterpret(ref location)));
 }
Beispiel #4
0
 public static SeqNum Exchange(ref SeqNum location, SeqNum value)
 {
     return((SeqNum)Interlocked.Exchange(ref Reinterpret(ref location), value.RawValue));
 }
Beispiel #5
0
 public static SeqNum Add(ref SeqNum location, int value)
 {
     return((SeqNum)Interlocked.Add(ref Reinterpret(ref location), value));
 }