Fence-based synchronization code added.