Thanks, Nick! Hmm, looks like the library thinks it is shut down correctly:
2022-11-22 10:26:06.214 thread(7) tag(13) INFO plc_tag_destroy:1512 Done.
2022-11-22 10:26:06.268 thread(2) tag(0) DETAIL tag_tickler_func:631 Tag tickler thread timed out waiting for something to do.
2022-11-22 10:26:06.327 thread(8) tag(0) INFO ab_teardown:142 Releasing global AB protocol resources.
2022-11-22 10:26:06.328 thread(8) tag(0) INFO ab_teardown:153 IO thread already stopped.
2022-11-22 10:26:06.328 thread(8) tag(0) INFO ab_teardown:156 Freeing session information.
2022-11-22 10:26:06.328 thread(8) tag(0) DETAIL mutex_destroy:841 destroying mutex 78B2F9E0
2022-11-22 10:26:06.328 thread(8) tag(0) DETAIL mutex_destroy:854 Done.
2022-11-22 10:26:06.328 thread(8) tag(0) INFO ab_teardown:162 Done.
2022-11-22 10:26:06.328 thread(8) tag(0) INFO mb_teardown:2391 Starting.
2022-11-22 10:26:06.328 thread(8) tag(0) DETAIL mb_teardown:2395 Destroying Modbus mutex.
2022-11-22 10:26:06.328 thread(8) tag(0) DETAIL mutex_destroy:841 destroying mutex 78B2F9F4
2022-11-22 10:26:06.328 thread(8) tag(0) DETAIL mutex_destroy:854 Done.
2022-11-22 10:26:06.328 thread(8) tag(0) INFO mb_teardown:2401 Done.
2022-11-22 10:26:06.328 thread(8) tag(0) INFO lib_teardown:171 Tearing down library.
2022-11-22 10:26:06.328 thread(8) tag(0) INFO lib_teardown:176 Signaling tag tickler condition var.
2022-11-22 10:26:06.329 thread(8) tag(0) INFO lib_teardown:181 Tearing down tag tickler thread.
2022-11-22 10:26:06.329 thread(2) tag(0) INFO tag_tickler_func:641 Terminating.
2022-11-22 10:26:06.329 thread(8) tag(0) INFO lib_teardown:188 Tearing down tag tickler condition var.
2022-11-22 10:26:06.329 thread(8) tag(0) DETAIL cond_destroy:1242 Starting.
2022-11-22 10:26:06.329 thread(8) tag(0) DETAIL cond_destroy:1253 Done.
2022-11-22 10:26:06.329 thread(8) tag(0) INFO lib_teardown:194 Tearing down tag lookup mutex.
2022-11-22 10:26:06.329 thread(8) tag(0) DETAIL mutex_destroy:841 destroying mutex 78B2F9A4
2022-11-22 10:26:06.329 thread(8) tag(0) DETAIL mutex_destroy:854 Done.
2022-11-22 10:26:06.329 thread(8) tag(0) INFO lib_teardown:200 Destroying tag hashtable.
2022-11-22 10:26:06.329 thread(8) tag(0) INFO hashtable_destroy:260 Starting
2022-11-22 10:26:06.329 thread(8) tag(0) INFO hashtable_destroy:272 Done
2022-11-22 10:26:06.330 thread(8) tag(0) INFO lib_teardown:207 Done.
2022-11-22 10:26:06.330 thread(8) tag(0) DETAIL mutex_destroy:841 destroying mutex 78B2F998
2022-11-22 10:26:06.330 thread(8) tag(0) DETAIL mutex_destroy:854 Done.
2022-11-22 10:26:06.330 thread(8) tag(0) DETAIL plc_tag_unregister_logger:1303 Starting
2022-11-22 10:26:06.330 thread(8) tag(0) DETAIL plc_tag_unregister_logger:1307 Done.
I see all the resources being cleaned up there. All the threads indicate that they are being terminated and all the mutexes are freed.
Maybe in the wrapper for plc_tag_shutdown, the .Net library can do those steps?
Best,
Kyle