nidaqmx-python icon indicating copy to clipboard operation
nidaqmx-python copied to clipboard

Can't close tasks in an event callback when using gRPC

Open texasaggie97 opened this issue 10 months ago • 1 comments

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

texasaggie97 avatar Apr 03 '24 18:04 texasaggie97

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.

zhindes avatar Apr 03 '24 18:04 zhindes