add threads.h and needed per-arch types for mtx_t and cnd_t