trustmaster / goflow

Flow-based and dataflow programming library for Go (golang)
MIT License
1.6k stars 125 forks source link

Prevent race condition for looper component. #30

Closed manadart closed 8 years ago

manadart commented 8 years ago

handlersDone.Add(1) and handlersDone.Wait() are both called on Goroutines.

This doesn't matter for other types of components, because they will block on at inputsClose.Wait(), but this isn't the case for loopers.

There is a race condition that causes intermittent panics in TestLooper

manadart commented 8 years ago

Hi Vladimir,

Any comment on these PRs? They aren't a big deal - just loose ends to make testing more deterministic and to pass with the -race flag.

We appreciate the library and would like to keep using your repository instead of moving to our own hard fork.

Many thanks.

trustmaster commented 8 years ago

@SpiritMachine sorry for a late merge, the PR got drowned in my GitHub feed, just noticed it and reviewed. Great job, thanks!

manadart commented 8 years ago

No problem, and thank you :+1: