Replace pthread with SDL