... with a really nifty finalizer attack!
Sweet Creamy Goodness!
I've been reading on this set of pages and wahoo!
If you are coming into contact with threading, and more-often than not, that's the case, you better become really really educated about stuff like defensive copying, TOCTOU, and other delicious topics that if ignored, you eventually end up with data races or even deadlock.
There's still a ton to learn, and the topics are only going to get more-advanced.
Always prefer designs that only share immutable state, if that's even necessary. Using Futures facilitates this, because the input to it can be immutable, and creation of the result is totally private to the future, and "returned" in a controlled way to the caller. The only synchronization point is on obtaining the result.