NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
344 stars 143 forks source link

Port is not closed if the current thread is interrupted #201

Open fwolter opened 3 years ago

fwolter commented 3 years ago

If the port is closed when the current Java thread is interrupted, the closing will be skipped silently.

IOLockedMutex.writeLock().tryLock() throws a InterruptedException here without even trying to acquire the lock. This skips the actual close without any notice.

Expected behavior would be to try at least one time to acquire the lock and close the port.