small changes for threads.h