Copy Aetheria Code
Added a bunch of code from the old Aetheria project
This commit is contained in:
parent
ab392cd3d6
commit
c58ba0b1da
1704 changed files with 175081 additions and 313 deletions
|
|
@ -0,0 +1,40 @@
|
|||
#if !(ENABLE_MONO_BLEEDING_EDGE_EDITOR || ENABLE_MONO_BLEEDING_EDGE_STANDALONE)
|
||||
|
||||
using System;
|
||||
|
||||
namespace UniRx
|
||||
{
|
||||
public struct CancellationToken
|
||||
{
|
||||
readonly ICancelable source;
|
||||
|
||||
public static readonly CancellationToken Empty = new CancellationToken(null);
|
||||
|
||||
/// <summary>Same as Empty.</summary>
|
||||
public static readonly CancellationToken None = new CancellationToken(null);
|
||||
|
||||
public CancellationToken(ICancelable source)
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public bool IsCancellationRequested
|
||||
{
|
||||
get
|
||||
{
|
||||
return (source == null) ? false : source.IsDisposed;
|
||||
}
|
||||
}
|
||||
|
||||
public void ThrowIfCancellationRequested()
|
||||
{
|
||||
if (IsCancellationRequested)
|
||||
{
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in a new issue