summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs')
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs b/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs
index f82492499c..fad3fc06c5 100644
--- a/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs
@@ -41,10 +41,6 @@ namespace System.Threading.Tasks
/// </remarks>
[DebuggerDisplay("Id={Id}")]
[DebuggerTypeProxy(typeof(SystemThreadingTasks_TaskSchedulerDebugView))]
- [HostProtection(Synchronization = true, ExternalThreading = true)]
-#pragma warning disable 618
- [PermissionSet(SecurityAction.InheritanceDemand, Unrestricted = true)]
-#pragma warning restore 618
public abstract class TaskScheduler
{
////////////////////////////////////////////////////////////
@@ -70,7 +66,6 @@ namespace System.Threading.Tasks
/// </remarks>
/// <param name="task">The <see cref="T:System.Threading.Tasks.Task">Task</see> to be queued.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="task"/> argument is null.</exception>
- [SecurityCritical]
protected internal abstract void QueueTask(Task task);
/// <summary>
@@ -113,7 +108,6 @@ namespace System.Threading.Tasks
/// null.</exception>
/// <exception cref="T:System.InvalidOperationException">The <paramref name="task"/> was already
/// executed.</exception>
- [SecurityCritical]
protected abstract bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued);
/// <summary>
@@ -157,7 +151,6 @@ namespace System.Threading.Tasks
/// <exception cref="T:System.NotSupportedException">
/// This scheduler is unable to generate a list of queued tasks at this time.
/// </exception>
- [SecurityCritical]
protected abstract IEnumerable<Task> GetScheduledTasks();
/// <summary>
@@ -185,7 +178,6 @@ namespace System.Threading.Tasks
/// <param name="taskWasPreviouslyQueued">True if the task may have been previously queued,
/// false if the task was absolutely not previously queued.</param>
/// <returns>True if it ran, false otherwise.</returns>
- [SecuritySafeCritical]
internal bool TryRunInline(Task task, bool taskWasPreviouslyQueued)
{
// Do not inline unstarted tasks (i.e., task.ExecutingTaskScheduler == null).
@@ -237,7 +229,6 @@ namespace System.Threading.Tasks
/// <param name="task">The <see cref="T:System.Threading.Tasks.Task">Task</see> to be dequeued.</param>
/// <returns>A Boolean denoting whether the <paramref name="task"/> argument was successfully dequeued.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="task"/> argument is null.</exception>
- [SecurityCritical]
protected internal virtual bool TryDequeue(Task task)
{
return false;
@@ -262,7 +253,6 @@ namespace System.Threading.Tasks
/// <summary>
/// Calls QueueTask() after performing any needed firing of events
/// </summary>
- [SecurityCritical]
internal void InternalQueueTask(Task task)
{
Contract.Requires(task != null);
@@ -444,7 +434,6 @@ namespace System.Threading.Tasks
/// <returns>A Boolean that is true if <paramref name="task"/> was successfully executed, false if it
/// was not. A common reason for execution failure is that the task had previously been executed or
/// is in the process of being executed by another thread.</returns>
- [SecurityCritical]
protected bool TryExecuteTask(Task task)
{
if (task.ExecutingTaskScheduler != this)
@@ -475,7 +464,6 @@ namespace System.Threading.Tasks
/// </remarks>
public static event EventHandler<UnobservedTaskExceptionEventArgs> UnobservedTaskException
{
- [System.Security.SecurityCritical]
add
{
if (value != null)
@@ -485,7 +473,6 @@ namespace System.Threading.Tasks
}
}
- [System.Security.SecurityCritical]
remove
{
lock (_unobservedTaskExceptionLockObject) _unobservedTaskException -= value;
@@ -531,7 +518,6 @@ namespace System.Threading.Tasks
/// <exception cref="T:System.NotSupportedException">
/// This scheduler is unable to generate a list of queued tasks at this time.
/// </exception>
- [SecurityCritical]
internal Task[] GetScheduledTasksForDebugger()
{
// this can throw InvalidOperationException indicating that they are unable to provide the info
@@ -566,7 +552,6 @@ namespace System.Threading.Tasks
/// It should not be called by any other codepaths.
/// </remarks>
/// <returns>An array of <see cref="System.Threading.Tasks.TaskScheduler">TaskScheduler</see> instances.</returns>
- [SecurityCritical]
internal static TaskScheduler[] GetTaskSchedulersForDebugger()
{
if (s_activeTaskSchedulers == null)
@@ -587,7 +572,7 @@ namespace System.Threading.Tasks
schedulers.CopyTo(arr, 0);
foreach (var scheduler in arr)
{
- Contract.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed");
+ Debug.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed");
int tmp = scheduler.Id; // force Ids for debugger
}
return arr;
@@ -613,7 +598,6 @@ namespace System.Threading.Tasks
// returns the schedulerís GetScheduledTasks
public IEnumerable<Task> ScheduledTasks
{
- [SecurityCritical]
get { return m_taskScheduler.GetScheduledTasks(); }
}
}
@@ -656,7 +640,6 @@ namespace System.Threading.Tasks
/// Simply posts the tasks to be executed on the associated <see cref="T:System.Threading.SynchronizationContext"/>.
/// </summary>
/// <param name="task"></param>
- [SecurityCritical]
protected internal override void QueueTask(Task task)
{
m_synchronizationContext.Post(s_postCallback, (object)task);
@@ -670,7 +653,6 @@ namespace System.Threading.Tasks
/// </summary>
/// <param name="task"></param>
/// <param name="taskWasPreviouslyQueued"></param>
- [SecurityCritical]
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
{
if (SynchronizationContext.Current == m_synchronizationContext)
@@ -682,7 +664,6 @@ namespace System.Threading.Tasks
}
// not implemented
- [SecurityCritical]
protected override IEnumerable<Task> GetScheduledTasks()
{
return null;