]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
Thread pool: Patch previous commit
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 7 Apr 2021 21:41:43 +0000 (16:41 -0500)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 7 Apr 2021 22:03:33 +0000 (17:03 -0500)
commit3700699020894fef7b34f9e8daf8a4c28cd2150b
tree08779a0e9f18f4b34051c6fa51126d4eed308d90
parentfc0b9ca1ce33141df9b0c7c2dc3c99f85d7bc800
Thread pool: Patch previous commit

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.
src/thread/thread_pool.c