On Thu Nov 14 16:11:49 2024 +0000, Rémi Bernon wrote:
This doesn't seem right, you'll be accessing source->cs without holding a reference on the source. There's a race condition if the stream is being disconnected in another thread. You will probably need to introduce a per-stream critical section, to guard the stream source reference. Other stream member accesses would probably need to be guarded as well if we want to be correct.
I fixed this with an SRW lock, because it allows shared access to get a source ref.