diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index 186b27cb4..10a7ea7d8 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -143,7 +143,7 @@ spdk_fio_cleanup_thread(struct spdk_fio_thread *fio_thread) spdk_set_thread(fio_thread->thread); - spdk_free_thread(fio_thread->thread); + spdk_thread_exit(fio_thread->thread); free(fio_thread->iocq); free(fio_thread); } diff --git a/include/spdk/thread.h b/include/spdk/thread.h index 0d3281f58..6d3d9f356 100644 --- a/include/spdk/thread.h +++ b/include/spdk/thread.h @@ -207,7 +207,7 @@ struct spdk_thread *spdk_thread_create(const char *name); * All I/O channel references associated with the thread must be released using * spdk_put_io_channel() prior to calling this function. */ -void spdk_free_thread(struct spdk_thread *thread); +void spdk_thread_exit(struct spdk_thread *thread); /** * Perform one iteration worth of processing on the thread. This includes diff --git a/lib/event/reactor.c b/lib/event/reactor.c index ef19d75d3..90583f3fe 100644 --- a/lib/event/reactor.c +++ b/lib/event/reactor.c @@ -355,7 +355,7 @@ _spdk_reactor_run(void *arg) spdk_set_thread(thread); _spdk_reactor_context_switch_monitor_stop(reactor, NULL); - spdk_free_thread(thread); + spdk_thread_exit(thread); return 0; } diff --git a/lib/thread/thread.c b/lib/thread/thread.c index fde543fae..6f428c095 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -234,7 +234,7 @@ spdk_set_thread(struct spdk_thread *thread) } void -spdk_free_thread(struct spdk_thread *thread) +spdk_thread_exit(struct spdk_thread *thread) { struct spdk_io_channel *ch; diff --git a/test/common/lib/ut_multithread.c b/test/common/lib/ut_multithread.c index 94c471ffd..719530fb5 100644 --- a/test/common/lib/ut_multithread.c +++ b/test/common/lib/ut_multithread.c @@ -103,7 +103,7 @@ free_threads(void) for (i = 0; i < g_ut_num_threads; i++) { set_thread(i); - spdk_free_thread(g_ut_threads[i].thread); + spdk_thread_exit(g_ut_threads[i].thread); g_ut_threads[i].thread = NULL; } diff --git a/test/unit/lib/blobfs/blobfs_sync_ut/blobfs_sync_ut.c b/test/unit/lib/blobfs/blobfs_sync_ut/blobfs_sync_ut.c index 96dc7fd32..cd4094e34 100644 --- a/test/unit/lib/blobfs/blobfs_sync_ut/blobfs_sync_ut.c +++ b/test/unit/lib/blobfs/blobfs_sync_ut/blobfs_sync_ut.c @@ -364,7 +364,7 @@ fs_delete_file_without_close(void) static void terminate_spdk_thread(void *arg) { - spdk_free_thread(spdk_get_thread()); + spdk_thread_exit(spdk_get_thread()); pthread_exit(NULL); } @@ -438,6 +438,6 @@ int main(int argc, char **argv) free(g_dev_buffer); send_request(terminate_spdk_thread, NULL); pthread_join(spdk_tid, NULL); - spdk_free_thread(thread); + spdk_thread_exit(thread); return num_failures; } diff --git a/test/unit/lib/nvmf/tcp.c/tcp_ut.c b/test/unit/lib/nvmf/tcp.c/tcp_ut.c index c837b0711..fbc345088 100644 --- a/test/unit/lib/nvmf/tcp.c/tcp_ut.c +++ b/test/unit/lib/nvmf/tcp.c/tcp_ut.c @@ -266,7 +266,7 @@ test_nvmf_tcp_create(void) transport = spdk_nvmf_tcp_create(&opts); CU_ASSERT_PTR_NULL(transport); - spdk_free_thread(thread); + spdk_thread_exit(thread); } static void @@ -294,7 +294,7 @@ test_nvmf_tcp_destroy(void) /* destroy transport */ CU_ASSERT(spdk_nvmf_tcp_destroy(transport) == 0); - spdk_free_thread(thread); + spdk_thread_exit(thread); } static void @@ -313,7 +313,7 @@ test_nvmf_tcp_poll_group_create(void) CU_ASSERT_PTR_NOT_NULL(group); spdk_nvmf_tcp_poll_group_destroy(group); - spdk_free_thread(thread); + spdk_thread_exit(thread); } static void diff --git a/test/unit/lib/thread/thread.c/thread_ut.c b/test/unit/lib/thread/thread.c/thread_ut.c index 13291d2ca..b15f2d010 100644 --- a/test/unit/lib/thread/thread.c/thread_ut.c +++ b/test/unit/lib/thread/thread.c/thread_ut.c @@ -351,7 +351,7 @@ thread_name(void) SPDK_CU_ASSERT_FATAL(thread != NULL); name = spdk_thread_get_name(thread); CU_ASSERT(name != NULL); - spdk_free_thread(thread); + spdk_thread_exit(thread); /* Create thread named "test_thread" */ thread = spdk_thread_create("test_thread"); @@ -361,7 +361,7 @@ thread_name(void) name = spdk_thread_get_name(thread); SPDK_CU_ASSERT_FATAL(name != NULL); CU_ASSERT(strcmp(name, "test_thread") == 0); - spdk_free_thread(thread); + spdk_thread_exit(thread); } static uint64_t device1;