N
nik
Hi,
How can I close a thread that is waiting on a file/port down
gracefully, and not have an IO error pop up?
I am having trouble closing a thread that is listening to the serial
port. I have a thread that calls uses a pySerial serial port and calls
readline() without a timeout, which is blocking. When I am shutting
down the application I close the serial port, which causes the IO
error: (9, 'Bad file descriptor'). It makes sense that we would get
this error, because it is trying to read off of a closed 'file'. Is
there a better way to close this thread and port down?
Thanks,
Nik
How can I close a thread that is waiting on a file/port down
gracefully, and not have an IO error pop up?
I am having trouble closing a thread that is listening to the serial
port. I have a thread that calls uses a pySerial serial port and calls
readline() without a timeout, which is blocking. When I am shutting
down the application I close the serial port, which causes the IO
error: (9, 'Bad file descriptor'). It makes sense that we would get
this error, because it is trying to read off of a closed 'file'. Is
there a better way to close this thread and port down?
Thanks,
Nik