Implementing memory barriers and volatile state values for image loaders