The wait() call without arguments could miss the initial emit(), if called too late, which could easily happen on VMs with less predictable timing.