Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asyn-thread: Don't block waiting on resolver threads during multi_done
This commit changes the behavior of libcurl to no longer block on incomplete resolve threads from the parent thread (ie the user's thread which is the multi perform thread) during multi_done. Instead it now orphans those threads in a master list which is culled periodically by soon-to-be exiting orphans to wait on and destroy those that are in the process of or have since exited, which is fast. On global cleanup we wait on and destroy any remaining threads, which may be slow but at that point we cannot defer it any longer. Ideally we would not wait for orphaned threads at all, but we have to because after global cleanup the user may choose to unload the shared library that is/contains libcurl. Note: thread_wait_resolv (Curl_resolver_wait_resolv) which blocks waiting for a resolver thread remains unchanged, since that is essentially the purpose of the function. It is currently called by FTP and SOCKS code, and continues to be a known issue that those two may block waiting for async resolves to finish. Fixes xxxxs://github.com/curl/issues/4852 Closes #xxxx
- Loading branch information
Showing
4 changed files
with
226 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters