An implementation of the cooperative cancellation model that is heavily inspired by the .NET implementation.