System.Threading.ClientInterlocked.Add C# (CSharp) Method

Add() public static method

public static Add ( int &location, int value ) : int
location int
value int
return int
        public static int Add(ref int location, int value)
        {
            return Interlocked.Add(ref location, value);
        }

Same methods

ClientInterlocked::Add ( long &location, long value ) : long

Usage Example

Beispiel #1
0
        public void EnterReadLock()
        {
            ClientSpinWait sw = new ClientSpinWait();

            do
            {
                while ((rwlock & (RwWrite | RwWait)) > 0)
                {
                    sw.SpinOnce();
                }

                if ((ClientInterlocked.Add(ref rwlock, RwRead) & (RwWait | RwWait)) == 0)
                {
                    return;
                }

                ClientInterlocked.Add(ref rwlock, -RwRead);
            } while (true);
        }
All Usage Examples Of System.Threading.ClientInterlocked::Add