model: hook up THREAD_JOIN and THREAD_FINISH actions