Exemple #1
0
 public FutureAwaiter(Future <TResult> future)
 {
     Registration     = new CancellationScope.Registration();
     Future           = future;
     HasDisposedValue = false;
     DisposedValue    = default(TResult);
 }
Exemple #2
0
 public FutureAwaiter(FutureWithDisposedValue <TResult> fwdv)
 {
     Registration     = new CancellationScope.Registration();
     Future           = fwdv.Future;
     HasDisposedValue = true;
     DisposedValue    = fwdv.DisposedValue;
 }
Exemple #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);
            }
Exemple #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);
            }
Exemple #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);
            }
Exemple #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);
            }
Exemple #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);
            }
Exemple #8
0
 public IFutureAwaiter(IFuture future)
 {
     Registration = new CancellationScope.Registration();
     Future       = future;
 }
Exemple #9
0
 public ISchedulableAwaiter(ISchedulable schedulable)
 {
     Registration = new CancellationScope.Registration();
     Schedulable  = schedulable;
     Future       = Registration.Scheduler.Start(schedulable, TaskExecutionPolicy.RunWhileFutureLives);
 }
Exemple #10
0
 public VoidFutureAwaiter(Future <NoneType> future)
 {
     Registration = new CancellationScope.Registration();
     Future       = future;
 }