System.Threading.ClientInterlocked.Increment C# (CSharp) Méthode

Increment() public static méthode

public static Increment ( int &location ) : int
location int
Résultat int
        public static int Increment(ref int location)
        {
            return Interlocked.Increment(ref location);
        }

Same methods

ClientInterlocked::Increment ( long &location ) : long

Usage Example

Exemple #1
0
        public void Exit(bool useMemoryBarrier)
        {
            RuntimeHelpers.PrepareConstrainedRegions();
            try { }
            finally
            {
                if (isThreadOwnerTrackingEnabled && !IsHeldByCurrentThread)
                {
                    throw new SynchronizationLockException("Current thread is not the owner of this lock");
                }

                threadWhoTookLock = int.MinValue;
                do
                {
                    if (useMemoryBarrier)
                    {
                        ClientInterlocked.Increment(ref ticket.Value);
                    }
                    else
                    {
                        ticket.Value++;
                    }
                } while (stallTickets != null && ((ClientConcurrentOrderedList <int>)stallTickets).TryRemove(ticket.Value));
            }
        }
All Usage Examples Of System.Threading.ClientInterlocked::Increment