Add some concurrency protection.