Solved some compatibility problems in pthread_t usage