Updating some thread code for std practices