Skip to content

Commit

Permalink
8327370
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuch committed Jun 19, 2024
1 parent 50bed6c commit 25dadfb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/java.base/share/classes/sun/nio/ch/Poller.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -190,7 +190,11 @@ private void poll(int fdVal, long nanos, BooleanSupplier supplier) throws IOExce
private void register(int fdVal) throws IOException {
Thread previous = map.put(fdVal, Thread.currentThread());
assert previous == null;
implRegister(fdVal);
try {
implRegister(fdVal);
} catch (IOException io) {
map.remove(fdVal);
}
}

/**
Expand Down

0 comments on commit 25dadfb

Please sign in to comment.