合并主线最近几年来的主要更新,重点推进TinyHttpClient,替代HttpClient
大石头 authored at 2023-03-08 18:39:12
547.00 B
X_NET20
using System.Collections.Concurrent;

namespace System.Threading.Tasks
{
	internal class TaskExceptionSlot
	{
		public volatile AggregateException Exception;

		public volatile bool Observed;

		public ConcurrentQueue<AggregateException> ChildExceptions;

		private Task parent;

		public TaskExceptionSlot(Task parent)
		{
			this.parent = parent;
		}

		~TaskExceptionSlot()
		{
			if (Exception != null && (!Observed && !TaskScheduler.FireUnobservedEvent(parent, Exception).Observed))
			{
				parent = null;
				throw Exception;
			}
		}
	}
}