mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
avoid crash when Selector.close is called more than once on the same instance
This commit is contained in:
parent
222b357089
commit
807f2a8d51
@ -106,8 +106,11 @@ class SocketSelector extends Selector {
|
||||
return selectedKeys.size();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
natClose(state);
|
||||
public synchronized void close() {
|
||||
if (isOpen()) {
|
||||
natClose(state);
|
||||
state = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static native long natInit();
|
||||
|
Loading…
Reference in New Issue
Block a user