解决MySql布尔型新旧版本兼容问题,采用枚举来表示布尔型的数据表。由正向工程赋值
大石头 authored at 2018-05-15 21:21:05
901.00 B
X
using System.Collections.Generic;
using System.Security;

namespace System.Threading.Tasks;

internal class TpScheduler : TaskScheduler
{
	private static readonly WaitCallback callback = TaskExecuterCallback;

	public override int MaximumConcurrencyLevel => base.MaximumConcurrencyLevel;

	[SecurityCritical]
	protected internal override void QueueTask(Task task)
	{
		ThreadPool.UnsafeQueueUserWorkItem(callback, task);
	}

	private static void TaskExecuterCallback(object obj)
	{
		Task task = (Task)obj;
		task.Execute();
	}

	protected override IEnumerable<Task> GetScheduledTasks()
	{
		throw new NotImplementedException();
	}

	[SecurityCritical]
	protected internal override bool TryDequeue(Task task)
	{
		throw new NotImplementedException();
	}

	[SecurityCritical]
	protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
	{
		return TryExecuteTask(task);
	}
}