modified mem_barrier