Possible outcomes:
- Thread is not
join()ed - ~thread calls terminate() calls abort()
- Thread is
join()ed during global destructor - indefinite hang
- Thread is
detach()ed - crash when thread tries to access now-unloaded code or memory
Test case here: https://gist.github.com/SpaceManiac/b23ec263e786c09dc89f0399b97e71fc