I accidentally removed a lock operation in the previous commit,
so lots of undefined behavior was being triggered.
Also, restores (but improves) the thread ready signal. It's hard to
explain:
- Before: Workers send ready signal to parent,
but parent might not be listening yet;
Therefore parent timeouts on wait.
- Previous: Workers do not send ready signal to parent.
Therefore, parent might signal work when no workers are ready yet;
Therefore nobody works.
- Now: Workers send ready signal to parent,
parent listens lazily (ie. late), but only if workers aren't ready
yet.
Therefore, correct behavior.