Fix Task AttachedToParent behavior. Fix bug #2777 part1.
authorJérémie Laval <jeremie.laval@gmail.com>
Thu, 2 Feb 2012 22:54:23 +0000 (23:54 +0100)
committerJérémie Laval <jeremie.laval@gmail.com>
Fri, 3 Feb 2012 02:56:18 +0000 (03:56 +0100)
commite325ea3653931d23183f167fd20c4051df6b3877
treeecc75c7e6a49ad25c2ad134b8e01e78d00aefb43
parent78b232a0d767fab3385a592a1ba10e80118720a4
Fix Task AttachedToParent behavior. Fix bug #2777 part1.

The problem was two folds. First, a parent task wasn't correctly waiting on the inner task continuations that were setup. Second, the way the Task parent field was re-used with a continuation collided with the parenting behavior of AttachedToParent (if the continuation was also created that way), the fix is to have two Task fields to differentiate between the two cases.
mcs/class/corlib/System.Threading.Tasks/Task.cs
mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs
mcs/class/corlib/System.Threading.Tasks/Task_T.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs