diff options
Diffstat (limited to 'src/mscorlib/src/System/Threading/Monitor.cs')
-rw-r--r-- | src/mscorlib/src/System/Threading/Monitor.cs | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/mscorlib/src/System/Threading/Monitor.cs b/src/mscorlib/src/System/Threading/Monitor.cs index fdbc384243..3ace3335aa 100644 --- a/src/mscorlib/src/System/Threading/Monitor.cs +++ b/src/mscorlib/src/System/Threading/Monitor.cs @@ -14,19 +14,20 @@ =============================================================================*/ -namespace System.Threading { - - using System; - using System.Runtime; - using System.Runtime.Remoting; - using System.Threading; - using System.Runtime.CompilerServices; - using System.Runtime.ConstrainedExecution; - using System.Runtime.Versioning; - using System.Diagnostics; - using System.Diagnostics.Contracts; - - public static class Monitor + +using System; +using System.Runtime; +using System.Runtime.Remoting; +using System.Threading; +using System.Runtime.CompilerServices; +using System.Runtime.ConstrainedExecution; +using System.Runtime.Versioning; +using System.Diagnostics; +using System.Diagnostics.Contracts; + +namespace System.Threading +{ + public static class Monitor { /*========================================================================= ** Obtain the monitor lock of obj. Will block if another thread holds the lock @@ -56,7 +57,7 @@ namespace System.Threading { private static void ThrowLockTakenException() { - throw new ArgumentException(Environment.GetResourceString("Argument_MustBeFalse"), "lockTaken"); + throw new ArgumentException(SR.Argument_MustBeFalse, "lockTaken"); } [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -75,7 +76,7 @@ namespace System.Threading { =========================================================================*/ [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void Exit(Object obj); - + /*========================================================================= ** Similar to Enter, but will never block. That is, if the current thread can ** acquire the monitor lock without blocking, it will do so and TRUE will @@ -99,7 +100,7 @@ namespace System.Threading { ReliableEnterTimeout(obj, 0, ref lockTaken); } - + /*========================================================================= ** Version of TryEnter that will block, but only up to a timeout period ** expressed in milliseconds. If timeout == Timeout.Infinite the method @@ -121,7 +122,7 @@ namespace System.Threading { { long tm = (long)timeout.TotalMilliseconds; if (tm < -1 || tm > (long)Int32.MaxValue) - throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); + throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); return (int)tm; } |