解决MySql布尔型新旧版本兼容问题,采用枚举来表示布尔型的数据表。由正向工程赋值
大石头 authored at 2018-05-15 21:21:05
526.00 B
X
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;
		}
	}
}