Using atomic operations instead of locks in some utility methods