asyn-thread: use pipe instead of socketpair for IPC when available

If pipe() is present. Less overhead.

Helped-by: Viktor Szakats
Closes #12146
This commit is contained in:
Daniel Stenberg 2023-10-17 17:56:09 +02:00
parent 64936919b9
commit 43eb798da0
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 22 additions and 21 deletions

View file

@ -25,6 +25,23 @@
***************************************************************************/
#include "curl_setup.h"
#ifdef HAVE_PIPE
#define wakeup_write write
#define wakeup_read read
#define wakeup_close close
#define wakeup_create pipe
#else /* HAVE_PIPE */
#define wakeup_write swrite
#define wakeup_read sread
#define wakeup_close sclose
#define wakeup_create(p) Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, p)
#endif /* HAVE_PIPE */
#ifndef HAVE_SOCKETPAIR
#include <curl/curl.h>