Checked the overhead of mutex lock and unlock.