does this need to be synchronized? currently 1 thread can enter the loop, another thread could execute 'terminate', and then thread 1 would wait() forever...