Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER where possible.