You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,54 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="TaskWrapperAsyncResult.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Wraps a Task class, optionally overriding the State object (since the Task Asynchronous Pattern doesn't normally use them).
|
||||
*
|
||||
* Copyright (c) 2010 Microsoft Corporation
|
||||
*/
|
||||
|
||||
namespace System.Web {
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
internal sealed class TaskWrapperAsyncResult : IAsyncResult {
|
||||
|
||||
private bool _forceCompletedSynchronously;
|
||||
|
||||
internal TaskWrapperAsyncResult(Task task, object asyncState) {
|
||||
Task = task;
|
||||
AsyncState = asyncState;
|
||||
}
|
||||
|
||||
public object AsyncState {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public WaitHandle AsyncWaitHandle {
|
||||
get { return ((IAsyncResult)Task).AsyncWaitHandle; }
|
||||
}
|
||||
|
||||
public bool CompletedSynchronously {
|
||||
get { return _forceCompletedSynchronously || ((IAsyncResult)Task).CompletedSynchronously; }
|
||||
}
|
||||
|
||||
public bool IsCompleted {
|
||||
get { return ((IAsyncResult)Task).IsCompleted; }
|
||||
}
|
||||
|
||||
internal Task Task {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
internal void ForceCompletedSynchronously() {
|
||||
_forceCompletedSynchronously = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user