Add() public static method

public static Add ( int &location, int value ) : int
location int
value int
return int
示例#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);
        }
示例#2
0
 public void ExitWriteLock()
 {
     ClientInterlocked.Add(ref rwlock, -RwWrite);
 }
示例#3
0
 public void ExitReadLock()
 {
     ClientInterlocked.Add(ref rwlock, -RwRead);
 }