Thread joining is an important primitive that I seem to have totally forgotten to implement previously.