gnurl_multi_wakeup(3)
π NAME π
curl_multi_wakeupβ wakes up a sleepingcurl_multi_pollcall π (yes bestie, this is thegnurl_multi_wakeup(3)page from the libgnurl manual, and it's lowkey iconic β¨)
π SYNOPSIS π
#include <gnurl/curl.h>
CURLMcode curl_multi_wakeup(CURLM *multi_handle);
π¦ DESCRIPTION π¦
Okay so this function can be called from any thread, and it wakes up a sleeping curl_multi_poll(3) call that is currently β or will be β waiting for activity or a timeout. Periodt π
If you call it when there is no curl_multi_poll(3) call happening, it will cause the next call to return immediately. Not me making future plans for your poll πβ¨
Calling this function only guarantees to wake up the current curl_multi_poll(3) call β or the next one if there is no current call. Which means it is possible that multiple calls to this function will wake up the same waiting operation. So don't expect a one-wakeup-per-call receipt, bestie π§Ύπ
And important: this function has no effect on curl_multi_wait(3) calls. Not even a little. π
π RETURN VALUE π
It returns a CURLMcode type β the general libcurl multi interface error code. That's the vibe check result π«Ά
β AVAILABILITY β
Added in 7.68.0 β a classic, honestly π
π₯ EXAMPLE π₯
Here's the whole example, no cap, exactly as the page lays it out:
CURL *easy_handle;
CURLM *multi_handle;
/* add the individual easy handle */
curl_multi_add_handle(multi_handle, easy_handle);
/* this is thread 1 */
do {
CURLMcode mc;
int numfds;
mc = curl_multi_perform(multi_handle, &still_running);
if(mc == CURLM_OK) {
/* wait for activity, timeout or wakeup */
mc = curl_multi_poll(multi_handle, NULL, 0, 10000, &numfds);
}
if(time_to_die())
exit(1);
} while(still_running);
curl_multi_remove_handle(multi_handle, easy_handle);
/* this is thread 2 */
if(something makes us decide to stop thread 1) {
set_something_to_signal_thread_1_to_exit();
curl_multi_wakeup(multi_handle);
}
π SEE ALSO π
kisses bestie π β this page is from libcurl 7.68.0, dated 17 Nov 2019, and it's the gnurl_multi_wakeup(3) manual page. Bye queen πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms