Change missing Task parent reference
[mono.git] / mcs / class / corlib / System.Threading.Tasks / Task_T.cs
index a9f99006c10a122331dcf6d7b42ecf68a44470ef..f02f17bf9d0f4938717ac7103f789e93d2801627 100644 (file)
@@ -91,7 +91,7 @@ namespace System.Threading.Tasks
                }
                
                public Task (Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions)
-                       : base (TaskActionInvoker.Create (function), null, cancellationToken, creationOptions, null)
+                       : base (TaskActionInvoker.Create (function), null, cancellationToken, creationOptions)
                {
                        if (function == null)
                                throw new ArgumentNullException ("function");
@@ -116,14 +116,14 @@ namespace System.Threading.Tasks
                }
 
                public Task (Func<object, TResult> function, object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions)
-                       : base (TaskActionInvoker.Create (function), state, cancellationToken, creationOptions, null)
+                       : base (TaskActionInvoker.Create (function), state, cancellationToken, creationOptions)
                {
                        if (function == null)
                                throw new ArgumentNullException ("function");
                }
 
-               internal Task (TaskActionInvoker invoker, object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, Task parent)
-                       : base (invoker, state, cancellationToken, creationOptions, parent)
+               internal Task (TaskActionInvoker invoker, object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, Task parent, Task contAncestor = null)
+                       : base (invoker, state, cancellationToken, creationOptions, parent, contAncestor)
                {
                }
 
@@ -159,6 +159,7 @@ namespace System.Threading.Tasks
                                           null,
                                           cancellationToken,
                                           GetCreationOptions (continuationOptions),
+                                          null,
                                           this);
                        ContinueWithCore (t, continuationOptions, scheduler);
                        
@@ -196,10 +197,11 @@ namespace System.Threading.Tasks
                                throw new ArgumentNullException ("scheduler");
 
                        var t = new Task<TNewResult> (TaskActionInvoker.Create (continuationFunction),
-                                                                  null,
-                                                                  cancellationToken,
-                                                                  GetCreationOptions (continuationOptions),
-                                                                  this);
+                                                     null,
+                                                     cancellationToken,
+                                                     GetCreationOptions (continuationOptions),
+                                                     null,
+                                                     this);
                        ContinueWithCore (t, continuationOptions, scheduler);
                        
                        return t;
@@ -259,10 +261,11 @@ namespace System.Threading.Tasks
                                throw new ArgumentNullException ("scheduler");
 
                        var t = new Task (TaskActionInvoker.Create (continuationAction),
-                                                          state,
-                                                          cancellationToken,
-                                                          GetCreationOptions (continuationOptions),
-                                                          this);
+                                         state,
+                                         cancellationToken,
+                                         GetCreationOptions (continuationOptions),
+                                         null,
+                                         this);
 
                        ContinueWithCore (t, continuationOptions, scheduler);
 
@@ -300,10 +303,11 @@ namespace System.Threading.Tasks
                                throw new ArgumentNullException ("scheduler");
 
                        var t = new Task<TNewResult> (TaskActionInvoker.Create (continuationFunction),
-                                                          state,
-                                                          cancellationToken,
-                                                          GetCreationOptions (continuationOptions),
-                                                          this);
+                                                     state,
+                                                     cancellationToken,
+                                                     GetCreationOptions (continuationOptions),
+                                                     null,
+                                                     this);
 
                        ContinueWithCore (t, continuationOptions, scheduler);