Consider the multi-thread case.