summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Threading/CountdownEvent.cs
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
commitdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch)
treee5435159cd1bf0519276363a6fe1663d1721bed3 /src/mscorlib/src/System/Threading/CountdownEvent.cs
parent4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff)
downloadcoreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'src/mscorlib/src/System/Threading/CountdownEvent.cs')
-rw-r--r--src/mscorlib/src/System/Threading/CountdownEvent.cs23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/mscorlib/src/System/Threading/CountdownEvent.cs b/src/mscorlib/src/System/Threading/CountdownEvent.cs
index 1374766863..d86a2ccfb8 100644
--- a/src/mscorlib/src/System/Threading/CountdownEvent.cs
+++ b/src/mscorlib/src/System/Threading/CountdownEvent.cs
@@ -11,10 +11,10 @@
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System;
-using System.Diagnostics;
using System.Security.Permissions;
using System.Runtime.InteropServices;
using System.Threading;
+using System.Diagnostics;
using System.Diagnostics.Contracts;
namespace System.Threading
@@ -32,7 +32,6 @@ namespace System.Threading
/// </remarks>
[ComVisible(false)]
[DebuggerDisplay("Initial Count={InitialCount}, Current Count={CurrentCount}")]
- [HostProtection(Synchronization = true, ExternalThreading = true)]
public class CountdownEvent : IDisposable
{
// CountdownEvent is a simple synchronization primitive used for fork/join parallelism. We create a
@@ -59,7 +58,7 @@ namespace System.Threading
{
if (initialCount < 0)
{
- throw new ArgumentOutOfRangeException("initialCount");
+ throw new ArgumentOutOfRangeException(nameof(initialCount));
}
m_initialCount = initialCount;
@@ -186,7 +185,7 @@ namespace System.Threading
public bool Signal()
{
ThrowIfDisposed();
- Contract.Assert(m_event != null);
+ Debug.Assert(m_event != null);
if (m_currentCount <= 0)
{
@@ -229,11 +228,11 @@ namespace System.Threading
{
if (signalCount <= 0)
{
- throw new ArgumentOutOfRangeException("signalCount");
+ throw new ArgumentOutOfRangeException(nameof(signalCount));
}
ThrowIfDisposed();
- Contract.Assert(m_event != null);
+ Debug.Assert(m_event != null);
int observedCount;
SpinWait spin = new SpinWait();
@@ -267,7 +266,7 @@ namespace System.Threading
return true;
}
- Contract.Assert(m_currentCount >= 0, "latch was decremented below zero");
+ Debug.Assert(m_currentCount >= 0, "latch was decremented below zero");
return false;
}
@@ -340,7 +339,7 @@ namespace System.Threading
{
if (signalCount <= 0)
{
- throw new ArgumentOutOfRangeException("signalCount");
+ throw new ArgumentOutOfRangeException(nameof(signalCount));
}
ThrowIfDisposed();
@@ -409,7 +408,7 @@ namespace System.Threading
if (count < 0)
{
- throw new ArgumentOutOfRangeException("count");
+ throw new ArgumentOutOfRangeException(nameof(count));
}
m_currentCount = count;
@@ -481,7 +480,7 @@ namespace System.Threading
long totalMilliseconds = (long)timeout.TotalMilliseconds;
if (totalMilliseconds < -1 || totalMilliseconds > int.MaxValue)
{
- throw new ArgumentOutOfRangeException("timeout");
+ throw new ArgumentOutOfRangeException(nameof(timeout));
}
return Wait((int)totalMilliseconds, new CancellationToken());
@@ -511,7 +510,7 @@ namespace System.Threading
long totalMilliseconds = (long)timeout.TotalMilliseconds;
if (totalMilliseconds < -1 || totalMilliseconds > int.MaxValue)
{
- throw new ArgumentOutOfRangeException("timeout");
+ throw new ArgumentOutOfRangeException(nameof(timeout));
}
return Wait((int)totalMilliseconds, cancellationToken);
@@ -555,7 +554,7 @@ namespace System.Threading
{
if (millisecondsTimeout < -1)
{
- throw new ArgumentOutOfRangeException("millisecondsTimeout");
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout));
}
ThrowIfDisposed();