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

InputReportProcessingThread is never closed #69

Open
adriencarbonaro opened this issue Nov 25, 2020 · 0 comments
Open

InputReportProcessingThread is never closed #69

adriencarbonaro opened this issue Nov 25, 2020 · 0 comments

Comments

@adriencarbonaro
Copy link

I've noticed that when I count the number of active threads, the InputReportProcessingThread is always active, even when device is disconnected.

The following line abort the InputReportReaderThread when device is disconnected but not the InputReportProcessingThread one.

self.__reading_thread.abort() #device disconnected

Step to reproduce :

  • Connect the HID device to the PC (Windows 10)
  • Count number of active threads using threading.active_count().
    • There should be 1 if no other threads have been launched.
    • I added a name parameter to the InputReportReaderThread and InputReportProcessingThread constructors so I can print active threads names :
    for t in threading.enumerate():
        print(t.name)
    
  • Use the API to find a device.
  • Before the device is opened, I see 1 active MainThread.
  • After the device is opened, I see 3 active threads (MainThread, tRead, tProc).
  • When I disconnect the device (unplug), and re check number and names of threads, I see 2 threads (MainThread, tProc).
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