Improved use of atomics.