Added return value checking to the windows CreateThread function.