pthread/random changes