Closed saravanan-13 closed 1 year ago
If the serialEventThread
is not returning for 500 ms, but is successfully returning after being manually interrupted, this sounds like most likely, the code within the serialEvent()
function of your data listener is doing something that is blocking forever (or for a really long time). Can you check this function and verify that you are not making any blocking calls within it? Ideally, posting this function would be helpful. Thanks!
Closing due to inactivity, not a bug.
removeDataListener function is waiting for the listener thread to be closed, But it is always getting interrupted after 500ms, causing a delay of 500ms during every listener add and remove interaction.
try { serialEventThread.join(500); if (serialEventThread.isAlive()) serialEventThread.interrupt(); serialEventThread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } serialEventThread = null;