合并主线最近几年来的主要更新,重点推进TinyHttpClient,替代HttpClient
大石头 authored at 2023-03-08 18:39:12
636.00 B
X_NET20
namespace System.Threading.Tasks
{
	internal class TaskConstants<T>
	{
		internal static readonly Task<T> Canceled;

		static TaskConstants()
		{
			TaskCompletionSource<T> tcs = new TaskCompletionSource<T>();
			tcs.SetCanceled();
			Canceled = tcs.Task;
		}
	}
	internal static class TaskConstants
	{
		public static readonly Task Finished;

		public static readonly Task Canceled;

		static TaskConstants()
		{
			TaskCompletionSource<object> tcs = new TaskCompletionSource<object>();
			tcs.SetResult(null);
			Finished = tcs.Task;
			tcs = new TaskCompletionSource<object>();
			tcs.SetCanceled();
			Canceled = tcs.Task;
		}
	}
}