lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

Might want to lock stuff here? #151

Open iProgramMC opened 3 years ago

iProgramMC commented 3 years ago

https://github.com/lidgren/lidgren-network-gen3/blob/f99b006d9af8a9a230ba7c5ce0320fc727ebae0c/Lidgren.Network/NetPeer.cs#L96

Might want to put this in lock brackets, like when getting Connections

PJB3005 commented 3 years ago

While it's perhaps not 100% kosher, reading integers is atomic in C# so with CoreCLR's current List<T> implementation there shouldn't actually be any chance of getting any threading bugs on this.

iProgramMC commented 3 years ago

That sounds perfect! I didn't know, thanks

On Mon, Feb 22, 2021, 21:00 Pieter-Jan Briers notifications@github.com wrote:

While it's perhaps not 100% kosher, reading integers is atomic in C# so with CoreCLR's current List implementation there shouldn't actually be any chance of getting any threading bugs on this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lidgren/lidgren-network-gen3/issues/151#issuecomment-783598657, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHFR5SLEI37BVHIHJC2SD3TAKSTZANCNFSM4YAHNVWA .