Tree
- Tree:
fcbc1d7004b3ca5e58c0d83f02de44ba1c87c298
- Date:
- Message:
- Fix race-y channel close/error assignment Data race occurred when assigning to err and then subsequently reading it from anywhere else. Moving the channel close down could potentially help, but far easier to just gate both with a sync.Once since this isn't a code path that seems like it needs to be super-performant. Changes cause CloseWithError to be call-able once, ensuring that there's no case where err is written to while being read (as would happen when closing and reading c.err from another goroutine the moment c.closed is closed). Signed-off-by: Noel Cower <ncower@gmail.com>
9pr/ | |
9ps/ |