Beispiel #1
0
 public FutureAwaiter(Future <TResult> future)
 {
     Registration     = new CancellationScope.Registration();
     Future           = future;
     HasDisposedValue = false;
     DisposedValue    = default(TResult);
 }
Beispiel #2
0
 public FutureAwaiter(FutureWithDisposedValue <TResult> fwdv)
 {
     Registration     = new CancellationScope.Registration();
     Future           = fwdv.Future;
     HasDisposedValue = true;
     DisposedValue    = fwdv.DisposedValue;
 }
Beispiel #3
0
            public ISchedulableAwaiter(ISchedulable schedulable)
            {
                Registration = new CancellationScope.Registration(TaskScheduler.Current);
                Schedulable  = schedulable;
                var ts = (TaskScheduler)Registration.Scheduler;

                Future = ts.Start(schedulable, TaskExecutionPolicy.RunWhileFutureLives);
            }
Beispiel #4
0
            public SequenceAwaiter(Future <T>[] futures)
            {
                Registration = new CancellationScope.Registration();

                Futures = futures;
                if (Futures.Length == 0)
                {
                    Ready = new SignalFuture(true);
                    return;
                }

                Ready = Future.WaitForAll(futures);
            }
Beispiel #5
0
            public SequenceAwaiter(Future <T>[] futures)
            {
                Registration = new CancellationScope.Registration(TaskScheduler.Current);

                Futures = futures;
                if (Futures.Length == 0)
                {
                    Ready = SignalFuture.Signaled;
                    return;
                }

                Ready = Future.WaitForAll(futures);
            }
Beispiel #6
0
            public SequenceAwaiter(ISchedulable <T>[] schedulables)
            {
                Registration = new CancellationScope.Registration();

                Futures = new Future <T> [schedulables.Length];
                if (Futures.Length == 0)
                {
                    Ready = new SignalFuture(true);
                    return;
                }

                for (var i = 0; i < Futures.Length; i++)
                {
                    Futures[i] = Registration.Scheduler.Start(schedulables[i]);
                }

                Ready = Future.WaitForAll(Futures);
            }
Beispiel #7
0
            public SequenceAwaiter(ISchedulable <T>[] schedulables)
            {
                Registration = new CancellationScope.Registration(TaskScheduler.Current);

                Futures = new Future <T> [schedulables.Length];
                if (Futures.Length == 0)
                {
                    Ready = SignalFuture.Signaled;
                    return;
                }

                var ts = (TaskScheduler)Registration.Scheduler;

                for (var i = 0; i < Futures.Length; i++)
                {
                    Futures[i] = ts.Start(schedulables[i]);
                }

                Ready = Future.WaitForAll(Futures);
            }
Beispiel #8
0
 public IFutureAwaiter(IFuture future)
 {
     Registration = new CancellationScope.Registration();
     Future       = future;
 }
Beispiel #9
0
 public ISchedulableAwaiter(ISchedulable schedulable)
 {
     Registration = new CancellationScope.Registration();
     Schedulable  = schedulable;
     Future       = Registration.Scheduler.Start(schedulable, TaskExecutionPolicy.RunWhileFutureLives);
 }
Beispiel #10
0
 public VoidFutureAwaiter(Future <NoneType> future)
 {
     Registration = new CancellationScope.Registration();
     Future       = future;
 }