Actually, I just realized the example I came up with is flawed in its choice of synchronization mechanism for each "iteration" so might not actually demonstrate the ordering changes as I had originally thought. I think we could probably come up with an example that does however.
Edit: here's a better example (I think...): Compiler Explorer