-
Notifications
You must be signed in to change notification settings - Fork 63
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
serial::windows::com::COMPort does not implement Send trait #16
Comments
@apoloval Thanks for catching this. I merged your PR that fixes this for Windows. Did you happen to try your serial port scanner on Unix as well? |
No, I didn't. But I guess there should be no problem. In Unix, file descriptors are integer values, which are |
@apoloval No worries. I came to the same conclusion. Just thought I'd check. |
I wrote something quick to verify that it works on Unix. Looks okay. |
I'm writing an application using
serial-rs
, and I've found an obstacle trying to use it in a multithreading context.The point is that I'm make a sort of serial port scanner. A listener thread will scan serial ports until a new device is connected. Then it creates a new thread and passes the
SerialPort
instance to it using move semantics.In order to do that,
SerialPort
implementations must implementSend
trait. The native implementation for Windows,serial::windows::com::COMPort
if I'm not wrong, does not according to the following compilation error:Moving the
SerialPort
instance from one thread to another should not be forbidden. Sharing it perhaps should not. Thus,Send
+'static
should be implemented butSync
should not.The text was updated successfully, but these errors were encountered: