project-iris / iris

Decentralized cloud messaging
iris.karalabe.com
Other
571 stars 32 forks source link

ThreadPool Broadcast instead of Signal #7

Closed abursavich closed 10 years ago

abursavich commented 10 years ago

In the event that Terminate is called multiple times on a ThreadPool before all tasks have been completed, Signal will only wake one of them and the extras will wait forever. It may be a misuse of the API to call Terminate multiple times but Broadcast will prevent this behavior.

karalabe commented 10 years ago

Perfect, thanks a lot :) I've also added a test that originally fails with Signal and passes with Broadcast.