简体   繁体   English

curl回调函数线程

[英]curl callback function threading

I have done some googling but haven't found the answer to this as of yet. 我已经进行了一些谷歌搜索,但是到目前为止还没有找到答案。

When you registrar a function with curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, function) is that function guaranteed to be completed before curl_easy_perform(curl) returns? 当您使用curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,function)注册一个函数时,该函数是否可以保证在curl_easy_perform(curl)返回之前完成? Or is it possible that function is being ran in parallel and may still be running when the easy_perform returns? 还是函数可以并行运行并且在easy_perform返回时仍可以运行?

尽管我没有经验性的源文件+行号来支持此功能,但多年来在各种项目中使用libcurl多次,但我可以自信地说:是的,curl_easy_perform将阻塞直到您提供的write函数完成被调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM