System.Threading.Interlocked.Exchange C# (CSharp) Method

Exchange() private method

private Exchange ( int &location1, int value ) : int
location1 int
value int
return int
        public static extern int Exchange(ref int location1, int value);

Usage Example

Esempio n. 1
0
 public override AbstractEdgeMap <T> Put(int key, T value)
 {
     if (key >= minIndex && key <= maxIndex)
     {
         T existing = Interlocked.Exchange(ref arrayData[key - minIndex], value);
         if (existing == null && value != null)
         {
             Interlocked.Increment(ref size);
         }
         else
         {
             if (existing != null && value == null)
             {
                 Interlocked.Decrement(ref size);
             }
         }
     }
     return(this);
 }
All Usage Examples Of System.Threading.Interlocked::Exchange