fixup usage of int vs. thread_id_t