diff options
author | Yann Ylavic <ylavic@apache.org> | 2021-11-19 13:23:11 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2021-11-19 13:23:11 +0000 |
commit | f046eb53d726c944b6ab72acfb97c1c13797f299 (patch) | |
tree | bb76224ec5059fe41df92be49527f66a5ddd355b /include/arch | |
parent | 1f24f3cb2a6b170cd694f72e21df25d271b9f0f2 (diff) | |
download | apr-f046eb53d726c944b6ab72acfb97c1c13797f299.tar.gz |
Follow up to r1895106: Use less expensive atomics for wakeup.
If pipe writers (wakeup) put a single byte until consume it's consumed by the
reader (drain), an atomic cas for the writers (still) and an atomic (re)set
for the reader is enough (not need to cas on the reader side).
This requires that the reader never blocks on read though (e.g. spurious return
from poll), so (re)make the read side on the pipe non-blocking (finally).
Since synchronous non-blocking read is not a thing for Windows' Readfile(), add
a ->socket flag this arch's to apr_file_t (like the existing ->pipe one) which
file_socket_pipe_create() will set to make apr_file_read/write() handle
non-blocking (nor overlapped) socket pipes with WSARecv/Send().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895175 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/arch')
-rw-r--r-- | include/arch/win32/apr_arch_file_io.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index cb02020f7..e226cfeb7 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -162,7 +162,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, struct apr_file_t { apr_pool_t *pool; HANDLE filehand; - BOOLEAN pipe; /* Is this a pipe of a file? */ + BOOLEAN pipe, socket; /* Is this a pipe, a socket or a file? */ OVERLAPPED *pOverlapped; apr_interval_time_t timeout; apr_int32_t flags; |