8327370: (ch) sun.nio.ch.Poller.register throws AssertionError
Co-authored-by: Alan Bateman <alanb@openjdk.org> Reviewed-by: alanb, jpai, djelinski
This commit is contained in:
parent
ed149062d0
commit
d2bebffb1f
@ -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
|
||||
@ -190,7 +190,12 @@ abstract class Poller {
|
||||
private void register(int fdVal) throws IOException {
|
||||
Thread previous = map.put(fdVal, Thread.currentThread());
|
||||
assert previous == null;
|
||||
implRegister(fdVal);
|
||||
try {
|
||||
implRegister(fdVal);
|
||||
} catch (Throwable t) {
|
||||
map.remove(fdVal);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user