mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
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 changed files with 7 additions and 2 deletions
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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 {
|
private void register(int fdVal) throws IOException {
|
||||||
Thread previous = map.put(fdVal, Thread.currentThread());
|
Thread previous = map.put(fdVal, Thread.currentThread());
|
||||||
assert previous == null;
|
assert previous == null;
|
||||||
implRegister(fdVal);
|
try {
|
||||||
|
implRegister(fdVal);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
map.remove(fdVal);
|
||||||
|
throw t;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue