Use thread.h definitions, rather than pthreads directly