Task Cancellation Bug?

Your expectation is correct; I reproduced the issue and this definitely seems quite off... We use an atomic change to mark the flag as cancelled so I'm a bit confused how this can happen.

Would you mind filing a bug on bugs.swift.org and I'll look into it in the meantime already?