| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There is a race condition where the state may not be set before the async task checks its value. This causes the server to shutdown with no warning. This change will fix this bug.
Fix bug where server may fail to start
| Back | FazBrowse Home | New Git URL |
There is a race condition in start() where setting the state to running can happen after the background task starts. The first thing this task does is guard strongSelf.operating else { return } which will fail is the state is not running. If the background task starts before the state is set then the background task will exit and the server will not respond.
I've fixed this by setting the state to running before creating the background task. Alternatively we can set the state within the background task.