diff --git a/test/common/lib/ut_multithread.c b/test/common/lib/ut_multithread.c index 889c0878e..ee7db98be 100644 --- a/test/common/lib/ut_multithread.c +++ b/test/common/lib/ut_multithread.c @@ -80,6 +80,8 @@ allocate_threads(int num_threads) struct spdk_thread *thread; uint32_t i; + spdk_thread_lib_init(NULL, 0); + g_ut_num_threads = num_threads; g_ut_threads = calloc(num_threads, sizeof(*g_ut_threads)); @@ -110,6 +112,8 @@ free_threads(void) g_ut_num_threads = 0; free(g_ut_threads); g_ut_threads = NULL; + + spdk_thread_lib_fini(); } bool diff --git a/test/unit/lib/thread/thread.c/thread_ut.c b/test/unit/lib/thread/thread.c/thread_ut.c index 7b96547cc..bd74be263 100644 --- a/test/unit/lib/thread/thread.c/thread_ut.c +++ b/test/unit/lib/thread/thread.c/thread_ut.c @@ -344,6 +344,8 @@ thread_name(void) struct spdk_thread *thread; const char *name; + spdk_thread_lib_init(NULL, 0); + /* Create thread with no name, which automatically generates one */ thread = spdk_thread_create(NULL, NULL); spdk_set_thread(thread); @@ -362,6 +364,8 @@ thread_name(void) SPDK_CU_ASSERT_FATAL(name != NULL); CU_ASSERT(strcmp(name, "test_thread") == 0); spdk_thread_exit(thread); + + spdk_thread_lib_fini(); } static uint64_t device1;