internal void TaskDone(ITask task, Exception e)
{
Interlocked.Increment (ref processedTasks);
if (e != null) {
if (UnhandledException != null)
UnhandledException (this, new UnhandledExceptionEventArgs (e, false));
var port = UnhandledExceptionPort;
if (port != null)
port.Post (e);
}
}