shadow: improve synchronization barrier usage