The ability to cancel an operation without talking to the operating system requires that your program has yield points. That yielding is what allows another part of the program to take control and say "OK, I'm done with you now, no need to finish".
Yes, the problem is that your thread would continue to perform work even if you stopped waiting on it.