libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.59k stars 937 forks source link

Fixed thread pool not creating enough new threads after awhile #868

Closed xfangfang closed 1 year ago

xfangfang commented 1 year ago
  1. InitialRun will never be false, so idle_thread_num will only be decremented once when deleting threads. As the tasks progress, idle_thread_num will increase, which will result in the inability to create new threads;
  2. Because idle_thread_num is size_t type, so it is unnecessary to judge whether it is less than 0;

Thank you very much for this project. I hope my fix is correct.

xfangfang commented 1 year ago

@COM8 Delete changes in threadpool.h