webcam-eyetracker
webcam-eyetracker copied to clipboard
Various threads do not close when close() is called
When close is called, I believe the behavior should be that the various thread processing threads and such are signaled to close. However, if connection with the eyetracker has closed, the _alive event is never unset, and as such the threads just continue to run.
Could you be more specific? I'm assuming you're referring to the OpenCV codebase, in which the _alive
Event is cleared when close
is called. Or am I missing something?
Also note that all Processes and Threads are set to deamon
, which means they (and their resources) are forcibly closed upon an unexpected exit. This shouldn't happen, as it can leave things in disarray, so feel free to implement a more gracious error-catching.
Sorry for taking so long to get back to you! I am indeed referring to the OpenCV codebase. There is a possibility I'm misunderstanding something, but in the close
function in generic.py, the body of the function only runs if self._connected
is true. So, for instance, if I enqueue all the images I want to process and close the connection before the images are processed, the threads will never join. I think the thread joining should probably happen regardless of whether the connection was open.