Open source development of the game Knight Online. This is a reversed engineered old version of the game aiming to replicate the nostalgic experience we all once had <3
MIT License
48
stars
21
forks
source link
Ensure socket ID list is guarded consistently #224
[x] Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
[x] Make sure you are making a pull request against the canary branch (left side). Also you should start your branch off our canary.
[x] Check the commit's or even all commits' message styles matches our requested structure.
[x] Check your code additions will fail neither code linting checks nor unit test.
Description
This prevents race conditions where the ID is removed from the list but not restored (causing a reduced number of available socket IDs in the list), or if especially unlucky, crashes.
The socket ID list is guarded more consistently in ReceiveWorkerThread() implementations, which we essentially follow here.
Ideally I'd have an implementation to better enforce scoping for these, but for consistency with the existing code I just continue to call EnterCriticalSection() & LeaveCriticalSection() manually.
Your checklist for this pull request
🚨Please review the guidelines for contributing to this repository.
Description
This prevents race conditions where the ID is removed from the list but not restored (causing a reduced number of available socket IDs in the list), or if especially unlucky, crashes.
The socket ID list is guarded more consistently in ReceiveWorkerThread() implementations, which we essentially follow here.
Ideally I'd have an implementation to better enforce scoping for these, but for consistency with the existing code I just continue to call EnterCriticalSection() & LeaveCriticalSection() manually.
💔Thank you!