File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2393,6 +2393,15 @@ def handleEventsTimeout(self, tv=0):
23932393
23942394 # TODO: handleEventsTimeoutCompleted
23952395
2396+ @_validContext
2397+ def interruptEventHandler (self ):
2398+ """
2399+ Interrupt any active thread that is handling events.
2400+ This is mainly useful for interrupting a dedicated event handling thread
2401+ when the application wishes to exit.
2402+ """
2403+ libusb1 .libusb_interrupt_event_handler (self .__context_p )
2404+
23962405 @_validContext
23972406 def setPollFDNotifiers (
23982407 self , added_cb = None , removed_cb = None , user_data = None ):
Original file line number Diff line number Diff line change @@ -566,6 +566,14 @@ def libusb_get_max_iso_packet_size(_, __):
566566 #int libusb_handle_events_locked(libusb_context *ctx, struct timeval *tv);
567567 libusb_handle_events_locked = libusb .libusb_handle_events_locked
568568 libusb_handle_events_locked .argtypes = [libusb_context_p , timeval_p ]
569+ #void libusb_interrupt_event_handler(libusb_context *ctx);
570+ try :
571+ libusb_interrupt_event_handler = libusb .libusb_interrupt_event_handler
572+ except AttributeError :
573+ def libusb_interrupt_event_handler (_ ):
574+ raise NotImplementedError
575+ else :
576+ libusb_interrupt_event_handler .argtypes = [libusb_context_p ]
569577 #int libusb_get_next_timeout(libusb_context *ctx, struct timeval *tv);
570578 libusb_get_next_timeout = libusb .libusb_get_next_timeout
571579 libusb_get_next_timeout .argtypes = [libusb_context_p , timeval_p ]
You can’t perform that action at this time.
0 commit comments