summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorThomas Munro2022-12-23 07:21:47 +0000
committerThomas Munro2022-12-23 07:21:47 +0000
commit30829e52ff1a026c0b6ad042e7e5f39ff6abf9bb (patch)
tree7aa08de7fcaf435a524a369aa28d898667f94c76 /src/include
parentf4f2f2b84a0bbf9edbfc4a8684040a941cd6d085 (diff)
Add WL_SOCKET_ACCEPT event to WaitEventSet API.
To be able to handle incoming connections on a server socket with the WaitEventSet API, we'll need a new kind of event to indicate that the the socket is ready to accept a connection. On Unix, it's just the same as WL_SOCKET_READABLE, but on Windows there is a different underlying kernel event that we need to map our abstraction to. No user yet, but a proposed patch would use this. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA%2BhUKG%2BZ-HpOj1JsO9eWUP%2Bar7npSVinsC_npxSy%2BjdOMsx%3DGg%40mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/latch.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/storage/latch.h b/src/include/storage/latch.h
index 68ab740f161..c55838db607 100644
--- a/src/include/storage/latch.h
+++ b/src/include/storage/latch.h
@@ -135,9 +135,16 @@ typedef struct Latch
#define WL_SOCKET_CONNECTED WL_SOCKET_WRITEABLE
#endif
#define WL_SOCKET_CLOSED (1 << 7)
+#ifdef WIN32
+#define WL_SOCKET_ACCEPT (1 << 8)
+#else
+/* avoid having to deal with case on platforms not requiring it */
+#define WL_SOCKET_ACCEPT WL_SOCKET_READABLE
+#endif
#define WL_SOCKET_MASK (WL_SOCKET_READABLE | \
WL_SOCKET_WRITEABLE | \
WL_SOCKET_CONNECTED | \
+ WL_SOCKET_ACCEPT | \
WL_SOCKET_CLOSED)
typedef struct WaitEvent