-set default exit code -spawn thread 1 -spawn thread 2 -get exit code from thread 2 -if exit code is from thread 2 - destroy thread 1