Patent ID: 8392922

Claim:
At a computer system including one or more processors and system memory, a computer-implemented method for marshaling the state of one task to another task, the computer-implemented method comprising: an act of receiving a call to a wrapping task from calling logic, the wrapping task having a result that is represented by a wrapped task wrapped within the wrapping task; an act of receiving at an unwrap component an extension call to the wrapping task and creating a proxy task; an act of returning the proxy task from the unwrap component to the calling logic, the proxy task returned to the calling logic without requiring the calling logic to wait for completion of either the wrapping task or the wrapped task; an act of determining at a completion state determination component of the unwrap component the completion state of the proxy task, the proxy task having a completion state that is determined by at least the completion state of the wrapped task when the completion state of the wrapping task indicates that the wrapping task ran to completion, and if the wrapped task is null then setting the state of the proxy to a canceled state otherwise the state of the proxy being determined from the completion state that is determined for the wrapped task; an act of setting the completion state of the proxy task based on the completion state determined by the completion state determination component; and an act of conveying from the unwrap component the completion state of the proxy task to the calling logic.