scream3r/java-simple-serial-connector — pull request #30 by therealchalz (2013-08-10 09:55:13+00:00)
Title: Changed blocking calls so they can be stopped with thread.interrupt()

Changed the native read functions to poll the java thread's interrupt status. If the thread has been interrupted at a high level with thread.interrupt(), then the unlimited blocking read call as well as the timeout read call will throw an exception almost immediately.

The benefit of this is that an application can close cleanly and quickly whenever it wants, instead of waiting for the timeout to elapse in the case of timed reads, or waiting a long time (or forever) for the indefinite reads.

Tested on Debian Wheezy x64 and Windows XP x86.