Add a notify RWMutex
Add a notify RWMutex

The added mutex covers mutating the slices of registered channels (ch.flows, ch.closes, ch.returns, ch.cancels). Previously these slices were covered by the channel mutex (ch.m) which is not acquired during calls to channel.dispatch() resulting in a “send on closed channel” panic when channel.shutdown() was called concurrently. Now uses it’s own mutex to avoid contention.

The channel confirms slice is unaffected as it locks internally.

streadway/amqp,streadway/amqp