Closed davecheney closed 7 years ago
My bad I didn't write Close function with concurrency support in mind. May I ask you what is the proper way to deal with multiple closing Go channel? Should I just use sync.Mutex
?
(There is also an issue with writing on Closed cache which should be fixed)
There are two problems,
one is setting closeCh to nil, which exposes a data race, the other is closing a channel twice. The best ways seems to be a mutex.
On Tue, Nov 29, 2016 at 11:49 AM, Quoc-Viet Nguyen <notifications@github.com
wrote:
My bad I didn't write Close function with concurrency support in mind. May I ask you what is the proper way to deal with multiple closing Go channel? Should I just use sync.Mutex?
(There is also an issue with writing on Closed cache)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/goburrow/cache/issues/4#issuecomment-263442657, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcA1wFdZNVZ-x6HKj2vWaL3hvFyZ8dks5rC3aQgaJpZM4K-an4 .
This test exposes and data race and crashes.