Threads can cancel other threads.
ResourceT and bracket are two ways for a thread to register clean-up code in the event that they are cancelled.