nidaqmx-python
nidaqmx-python copied to clipboard
Can't close tasks in an event callback when using gRPC
test___done_event_registered___call_clear_in_callback___stop_close_in_callback_with_success_status
and test___every_n_samples_event_registered___call_clear_in_callback___stop_close_in_callback_with_success_status
fail when closing a task in an event callback.
This is supported when not using gRPC
task.close() closes all open event handlers and then GrpcEventHandler.close() joins its event thread. When calling task.close
from the event itself, the current thread is the event thread. A thread joining itself doesn't work so well. I think we just need a check for that case.