Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jtermios.windows.JTermiosImpl$Fail when using multiple Threads #130

Open
Siebje opened this issue Apr 3, 2020 · 0 comments
Open

jtermios.windows.JTermiosImpl$Fail when using multiple Threads #130

Siebje opened this issue Apr 3, 2020 · 0 comments

Comments

@Siebje
Copy link

Siebje commented Apr 3, 2020

I encountered a problem when using multiple threads, and to be honest, I'm not sure if this is a bug in the library or Windows being silly. However, I feel like it could be a solvable issue.

The problem is that it seems to be okay to write to a port from different threads as long as all threads stay alive in the lifetime of the connection. If any of the threads die while the port is open, jtermios.windows.JTermiosImpl$Fail is thrown.

I have included a testcase that can reliably reproduce the issue. Simply connect a loopback port (I used an FTDI cable with TX and RX shorted) and run the test. You'll see that if I keep the thread alive, all is fine, but if the thread finishes, the error occurs.
ComThreading.java.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant