From dc3b3f63ba34e2189d9e57fd83b1d4ce5a52385e Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 1 Mar 2024 09:58:47 -0800 Subject: [PATCH] add an extra comment about the event.data shift --- src/sys/windows/named_pipe.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sys/windows/named_pipe.rs b/src/sys/windows/named_pipe.rs index 8ec075d5a..eb35d3797 100644 --- a/src/sys/windows/named_pipe.rs +++ b/src/sys/windows/named_pipe.rs @@ -1001,6 +1001,11 @@ impl Io { fn schedule_event(&self, me: &Arc, mut event: Event) { // Alter the token so that the selector will identify the IOCP event as // one for a named pipe. This will be reversed in `event_done` + // + // `data` for named pipes is an auto-incrementing counter. Because + // `data` is `u64` we do not risk losing the most-significant bit + // (unless a user creates 2^62 named pipes during the lifetime of the + // process). event.data <<= 1; event.data += 1;