fix: Avoid deadlock on downsizing of threadpool#38
Conversation
2b25f94 to
395842e
Compare
|
This fixes two different deadlocks when downsizing. The first, was that the heartbeat thread wouldn't shut down because we tried to join the heartbeath thread while still holding the lock on the threadpool's state mutex, which the heartbeat thread also needed to lock before it could know to shut down. The second deadlock was that the worker threads weren't being woken up, so didn't know that they needed to shut down. There are existing tests that were hitting these deadlocks. e.g. Issue #37 |
NthTensor
left a comment
There was a problem hiding this comment.
This looks good, thanks for the contribution! And sorry for the slight delay, I had taken a brief hiatus from working on this.
This fix is quite similar to some changes I have locally. Actually I have built up a bit of a backlog of local changes and fixes -- this was probably fine during the R&D phase, but if people like you are actually evaluating the library I guess I need to be a bit more proactive in publishing my work.
No description provided.