Ported thread APIs.