supports multiple calls and thread join.