Added thread cancel and thread join APIs.