added curthread.h