Skip to content

Commit

Permalink
add an extra comment about the event.data shift
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche authored and Thomasdezeeuw committed Mar 1, 2024
1 parent 04c3bb6 commit dc3b3f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sys/windows/named_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,11 @@ impl Io {
fn schedule_event(&self, me: &Arc<Inner>, 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;

Expand Down

0 comments on commit dc3b3f6

Please sign in to comment.