From db20f3f1bb8595633a7e16c8900fd401a453a6b5 Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Tue, 27 Dec 2016 16:46:08 +0900 Subject: Imported Upstream version 1.0.0.9127 --- src/mscorlib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/mscorlib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs') diff --git a/src/mscorlib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs b/src/mscorlib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs index dd4cbc9a66..5c6ca9bb76 100644 --- a/src/mscorlib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs +++ b/src/mscorlib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs @@ -13,6 +13,7 @@ using System; using System.Security; +using System.Diagnostics; using System.Diagnostics.Contracts; using System.Collections.Generic; using System.Text; @@ -39,7 +40,7 @@ namespace System.Threading.Tasks { Contract.Requires(obj != null, "TaskScheduler.LongRunningThreadWork: obj is null"); Task t = obj as Task; - Contract.Assert(t != null, "TaskScheduler.LongRunningThreadWork: t is null"); + Debug.Assert(t != null, "TaskScheduler.LongRunningThreadWork: t is null"); t.ExecuteEntry(false); } @@ -47,7 +48,6 @@ namespace System.Threading.Tasks /// Schedules a task to the ThreadPool. /// /// The task to schedule. - [SecurityCritical] protected internal override void QueueTask(Task task) { if ((task.Options & TaskCreationOptions.LongRunning) != 0) @@ -73,7 +73,6 @@ namespace System.Threading.Tasks /// IMPORTANT NOTE: TryExecuteTaskInline will NOT throw task exceptions itself. Any wait code path using this function needs /// to account for exceptions that need to be propagated, and throw themselves accordingly. /// - [SecurityCritical] protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) { // If the task was previously scheduled, and we can't pop it, then return false. @@ -95,14 +94,12 @@ namespace System.Threading.Tasks return rval; } - [SecurityCritical] protected internal override bool TryDequeue(Task task) { // just delegate to TP return ThreadPool.TryPopCustomWorkItem(task); } - [SecurityCritical] protected override IEnumerable GetScheduledTasks() { return FilterTasksFromWorkItems(ThreadPool.GetQueuedWorkItems()); -- cgit v1.2.3