lsalzman / enet

ENet reliable UDP networking library
MIT License
2.73k stars 670 forks source link

ENetCrc32 thread-safe? #196

Closed playingoDEERUX closed 2 years ago

playingoDEERUX commented 2 years ago

Question in title, I have seen that there are seemingly global static variables used such as "static enet_uint32 crcTable [256];", "initializedCRC32" (all in packet.c), so a thread-safety concern arises instantly there. May I ask, are they thread-safe by any means? Do I have to ensure every thread/host has its own crctable and initializedCRC32 ??

Thanks in advance!

playingoDEERUX commented 2 years ago

(sincerely I have been wondering why these aren't encapsulated in the ENetHost structure itself in first place, seems like a weird design choice to me, somebody explain me sorry...)