nedpals / vex

Easy-to-use, modular web framework built for V
https://nedpals.github.io/vex
MIT License
339 stars 28 forks source link

Add case for thread-limit 0 and fix thread freeze #51

Closed benstigsen closed 2 years ago

benstigsen commented 2 years ago

So before this, if the thread limit was 0, then we'd call manager.add() in a loop many times, even though a thread will never be available.

Previously, requests were also handled in a blocking way if no thread was available. But this would result in a freeze if more concurrent connections, higher than the thread limit tried to create a connection. So now we just wait for a thread to be available instead, which removes the freeze.