Closed cwaldren-ld closed 1 month ago
This resolves a data race in the Broadcaster implementation, specifically HasListeners() was not protected by a lock.
HasListeners()
Additionally it swaps out the mutex for a RWLock so that concurrent readers don't block each other.
RWLock
A behavioral change is that the Broadcast method now locks the subscribers array, so that Add or RemoveListener cannot be called concurrently.
Broadcast
Add
RemoveListener
This resolves a data race in the Broadcaster implementation, specifically
HasListeners()
was not protected by a lock.Additionally it swaps out the mutex for a
RWLock
so that concurrent readers don't block each other.A behavioral change is that the
Broadcast
method now locks the subscribers array, so thatAdd
orRemoveListener
cannot be called concurrently.