prevented a race with non-deterministic threads