Actually, there are still locks involved, as channels use futexes internally. Also, if the Pool is meant to be used concurrently, this looks racy, I suggest you run your tests with the -race option.
Martin
The non-chan fields of the struct are not protected, and len and cap are not thread-safe.
You're right, cap doesn't matter. But if Destory is called concurrently with Get, there is a race. That's why I asked if Pool was meant to be used concurrently (which I suppose it is). Matt put it more clearly than I did.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/E467Ec0-bYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/E467Ec0-bYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.