threads, model, schedule: refactor thread joining