Fix an issue on multi-core environment.