From: Phil Garcia Date: Mon, 26 Mar 2018 04:18:46 +0000 (-0700) Subject: Fixed a few typos (#17215) X-Git-Tag: accepted/tizen/unified/20190422.045933~2510 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4934d1c28caa034d56c1bd8c1676d2b2bdade77;p=platform%2Fupstream%2Fcoreclr.git Fixed a few typos (#17215) * Fixed a few typos * Fixed a few typos --- diff --git a/src/mscorlib/src/System/Threading/SpinLock.cs b/src/mscorlib/src/System/Threading/SpinLock.cs index 917ece2..7334f1e 100644 --- a/src/mscorlib/src/System/Threading/SpinLock.cs +++ b/src/mscorlib/src/System/Threading/SpinLock.cs @@ -84,7 +84,7 @@ namespace System.Threading private const int ID_DISABLED_AND_ANONYMOUS_OWNED = unchecked((int)0x80000001); //1000 0000 0000 0000 0000 0000 0000 0001 // If the thread is unowned if: - // m_owner zero and the threa tracking is enabled + // m_owner zero and the thread tracking is enabled // m_owner & LOCK_ANONYMOUS_OWNED = zero and the thread tracking is disabled private const int LOCK_UNOWNED = 0; @@ -306,7 +306,7 @@ namespace System.Threading // In this case there are three ways to acquire the lock // 1- the first way the thread either tries to get the lock if it's free or updates the waiters, if the turn >= the processors count then go to 3 else go to 2 // 2- In this step the waiter threads spins and tries to acquire the lock, the number of spin iterations and spin count is dependent on the thread turn - // the late the thread arrives the more it spins and less frequent it check the lock avilability + // the late the thread arrives the more it spins and less frequent it check the lock availability // Also the spins count is increases each iteration // If the spins iterations finished and failed to acquire the lock, go to step 3 // 3- This is the yielding step, there are two ways of yielding Thread.Yield and Sleep(1) @@ -322,19 +322,19 @@ namespace System.Threading { if (CompareExchange(ref m_owner, observedOwner | 1, observedOwner, ref lockTaken) == observedOwner) { - // Aquired lock + // Acquired lock return; } if (millisecondsTimeout == 0) { - // Did not aquire lock in CompareExchange and timeout is 0 so fail fast + // Did not acquire lock in CompareExchange and timeout is 0 so fail fast return; } } else if (millisecondsTimeout == 0) { - // Did not aquire lock as owned and timeout is 0 so fail fast + // Did not acquire lock as owned and timeout is 0 so fail fast return; } else //failed to acquire the lock,then try to update the waiters. If the waiters count reached the maximum, jsut break the loop to avoid overflow @@ -362,7 +362,7 @@ namespace System.Threading if ((observedOwner & LOCK_ANONYMOUS_OWNED) == LOCK_UNOWNED) { int newOwner = (observedOwner & WAITERS_MASK) == 0 ? // Gets the number of waiters, if zero - observedOwner | 1 // don't decrement it. just set the lock bit, it is zzero because a previous call of Exit(false) ehich corrupted the waiters + observedOwner | 1 // don't decrement it. just set the lock bit, it is zero because a previous call of Exit(false) which corrupted the waiters : (observedOwner - 2) | 1; // otherwise decrement the waiters and set the lock bit Debug.Assert((newOwner & WAITERS_MASK) >= 0); @@ -486,8 +486,8 @@ namespace System.Threading /// public void Exit(bool useMemoryBarrier) { - // This is the fast path for the thread tracking is diabled and not to use memory barrier, otherwise go to the slow path - // The reason not to add else statement if the usememorybarrier is that it will add more barnching in the code and will prevent + // This is the fast path for the thread tracking is disabled and not to use memory barrier, otherwise go to the slow path + // The reason not to add else statement if the usememorybarrier is that it will add more branching in the code and will prevent // method inlining, so this is optimized for useMemoryBarrier=false and Exit() overload optimized for useMemoryBarrier=true. int tmpOwner = m_owner; if ((tmpOwner & LOCK_ID_DISABLE_MASK) != 0 & !useMemoryBarrier) diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs index 8778abc..51bfd27 100644 --- a/src/mscorlib/src/System/Threading/Thread.cs +++ b/src/mscorlib/src/System/Threading/Thread.cs @@ -213,7 +213,7 @@ namespace System.Threading IntPtr thread = DONT_USE_InternalThread; // This should never happen under normal circumstances. m_assembly is always assigned before it is handed out to the user. - // There are ways how to create an unitialized objects through remoting, etc. Avoid AVing in the EE by throwing a nice + // There are ways how to create an uninitialized objects through remoting, etc. Avoid AVing in the EE by throwing a nice // exception here. if (thread == IntPtr.Zero) throw new ArgumentException(null, SR.Argument_InvalidHandle); @@ -257,7 +257,7 @@ namespace System.Threading if (m_Delegate != null) { // If we reach here with a null delegate, something is broken. But we'll let the StartInternal method take care of - // reporting an error. Just make sure we dont try to dereference a null delegate. + // reporting an error. Just make sure we don't try to dereference a null delegate. ThreadHelper t = (ThreadHelper)(m_Delegate.Target); ExecutionContext ec = ExecutionContext.Capture(); t.SetExecutionContextHelper(ec); @@ -290,7 +290,7 @@ namespace System.Threading /*========================================================================= ** Suspends the current thread for timeout milliseconds. If timeout == 0, - ** forces the thread to give up the remainer of its timeslice. If timeout + ** forces the thread to give up the remainder of its timeslice. If timeout ** == Timeout.Infinite, no timeout will occur. ** ** Exceptions: ArgumentException if timeout < 0. @@ -313,9 +313,9 @@ namespace System.Threading } - /* wait for a length of time proportial to 'iterations'. Each iteration is should + /* wait for a length of time proportional to 'iterations'. Each iteration is should only take a few machine instructions. Calling this API is preferable to coding - a explict busy loop because the hardware can be informed that it is busy waiting. */ + a explicit busy loop because the hardware can be informed that it is busy waiting. */ [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern void SpinWaitInternal(int iterations); @@ -528,7 +528,7 @@ namespace System.Threading } // End of class Thread // declaring a local var of this enum type and passing it by ref into a function that needs to do a - // stack crawl will both prevent inlining of the calle and pass an ESP point to stack crawl to + // stack crawl will both prevent inlining of the callee and pass an ESP point to stack crawl to // Declaring these in EH clauses is illegal; they must declared in the main method body internal enum StackCrawlMark { diff --git a/src/mscorlib/src/System/Threading/ThreadPool.cs b/src/mscorlib/src/System/Threading/ThreadPool.cs index 69c189f..ad70726 100644 --- a/src/mscorlib/src/System/Threading/ThreadPool.cs +++ b/src/mscorlib/src/System/Threading/ThreadPool.cs @@ -241,7 +241,7 @@ namespace System.Threading // And then check to see if we can fix up the indexes (if we're at // the edge). If we can't, we just leave nulls in the array and they'll - // get filtered out eventually (but may lead to superflous resizing). + // get filtered out eventually (but may lead to superfluous resizing). if (i == m_tailIndex) m_tailIndex -= 1; else if (i == m_headIndex) @@ -655,7 +655,7 @@ namespace System.Threading } } - // Holds a WorkStealingQueue, and remmoves it from the list when this object is no longer referened. + // Holds a WorkStealingQueue, and removes it from the list when this object is no longer referenced. internal sealed class ThreadPoolWorkQueueThreadLocals { [ThreadStatic] @@ -866,7 +866,7 @@ namespace System.Threading public delegate void WaitCallback(Object state); - public delegate void WaitOrTimerCallback(Object state, bool timedOut); // signalled or timed out + public delegate void WaitOrTimerCallback(Object state, bool timedOut); // signaled or timed out // // This type is necessary because VS 2010's debugger looks for a method named _ThreadPoolWaitCallbacck.PerformWaitCallback