Set the shutdown flag before killing the reader

This commit is contained in:
Cameron Gutman 2015-12-21 15:04:22 -08:00
parent 563c90a8c4
commit 7d2647f830

View File

@ -156,6 +156,9 @@ public class EvdevHandler {
// we could get stuck waiting on output from the process
// in order to terminate it.
shutdown = true;
handlerThread.interrupt();
if (evdevIn != null) {
try {
evdevIn.close();
@ -176,9 +179,6 @@ public class EvdevHandler {
reader.destroy();
}
shutdown = true;
handlerThread.interrupt();
try {
handlerThread.join();
} catch (InterruptedException ignored) {}