Fix #2763: ConnectionMultiplexer.Subscription is not Thread-safe by Chuck-EP · Pull Request #2769 · StackExchange/StackExchange.Redis (original) (raw)

Issue

#2763

Solution

Simply added a lock around _handlers in ConnectionMultiplexer.Subscription, like I was suggesting in the issue.

Unit Test

I added one that does exactly what the example code in #2763 was doing & testing for. I used the other tests as template/guide, let me know if something isn't up to spec.