thread: Rename spdk_free_thread to spdk_thread_exit
This name more closely resembles pthread_exit, which is a closer analogy to how the new threading library works. Change-Id: I68b04509f3ff8e94b8688804a7e5661155a3ecd1 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/440597 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
b1c79d722b
commit
9cba82b955
@ -143,7 +143,7 @@ spdk_fio_cleanup_thread(struct spdk_fio_thread *fio_thread)
|
|||||||
|
|
||||||
spdk_set_thread(fio_thread->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->iocq);
|
||||||
free(fio_thread);
|
free(fio_thread);
|
||||||
}
|
}
|
||||||
|
@ -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
|
* All I/O channel references associated with the thread must be released using
|
||||||
* spdk_put_io_channel() prior to calling this function.
|
* 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
|
* Perform one iteration worth of processing on the thread. This includes
|
||||||
|
@ -355,7 +355,7 @@ _spdk_reactor_run(void *arg)
|
|||||||
|
|
||||||
spdk_set_thread(thread);
|
spdk_set_thread(thread);
|
||||||
_spdk_reactor_context_switch_monitor_stop(reactor, NULL);
|
_spdk_reactor_context_switch_monitor_stop(reactor, NULL);
|
||||||
spdk_free_thread(thread);
|
spdk_thread_exit(thread);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ spdk_set_thread(struct spdk_thread *thread)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
spdk_free_thread(struct spdk_thread *thread)
|
spdk_thread_exit(struct spdk_thread *thread)
|
||||||
{
|
{
|
||||||
struct spdk_io_channel *ch;
|
struct spdk_io_channel *ch;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ free_threads(void)
|
|||||||
|
|
||||||
for (i = 0; i < g_ut_num_threads; i++) {
|
for (i = 0; i < g_ut_num_threads; i++) {
|
||||||
set_thread(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;
|
g_ut_threads[i].thread = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ fs_delete_file_without_close(void)
|
|||||||
static void
|
static void
|
||||||
terminate_spdk_thread(void *arg)
|
terminate_spdk_thread(void *arg)
|
||||||
{
|
{
|
||||||
spdk_free_thread(spdk_get_thread());
|
spdk_thread_exit(spdk_get_thread());
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,6 +438,6 @@ int main(int argc, char **argv)
|
|||||||
free(g_dev_buffer);
|
free(g_dev_buffer);
|
||||||
send_request(terminate_spdk_thread, NULL);
|
send_request(terminate_spdk_thread, NULL);
|
||||||
pthread_join(spdk_tid, NULL);
|
pthread_join(spdk_tid, NULL);
|
||||||
spdk_free_thread(thread);
|
spdk_thread_exit(thread);
|
||||||
return num_failures;
|
return num_failures;
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ test_nvmf_tcp_create(void)
|
|||||||
transport = spdk_nvmf_tcp_create(&opts);
|
transport = spdk_nvmf_tcp_create(&opts);
|
||||||
CU_ASSERT_PTR_NULL(transport);
|
CU_ASSERT_PTR_NULL(transport);
|
||||||
|
|
||||||
spdk_free_thread(thread);
|
spdk_thread_exit(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -294,7 +294,7 @@ test_nvmf_tcp_destroy(void)
|
|||||||
/* destroy transport */
|
/* destroy transport */
|
||||||
CU_ASSERT(spdk_nvmf_tcp_destroy(transport) == 0);
|
CU_ASSERT(spdk_nvmf_tcp_destroy(transport) == 0);
|
||||||
|
|
||||||
spdk_free_thread(thread);
|
spdk_thread_exit(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -313,7 +313,7 @@ test_nvmf_tcp_poll_group_create(void)
|
|||||||
CU_ASSERT_PTR_NOT_NULL(group);
|
CU_ASSERT_PTR_NOT_NULL(group);
|
||||||
spdk_nvmf_tcp_poll_group_destroy(group);
|
spdk_nvmf_tcp_poll_group_destroy(group);
|
||||||
|
|
||||||
spdk_free_thread(thread);
|
spdk_thread_exit(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -351,7 +351,7 @@ thread_name(void)
|
|||||||
SPDK_CU_ASSERT_FATAL(thread != NULL);
|
SPDK_CU_ASSERT_FATAL(thread != NULL);
|
||||||
name = spdk_thread_get_name(thread);
|
name = spdk_thread_get_name(thread);
|
||||||
CU_ASSERT(name != NULL);
|
CU_ASSERT(name != NULL);
|
||||||
spdk_free_thread(thread);
|
spdk_thread_exit(thread);
|
||||||
|
|
||||||
/* Create thread named "test_thread" */
|
/* Create thread named "test_thread" */
|
||||||
thread = spdk_thread_create("test_thread");
|
thread = spdk_thread_create("test_thread");
|
||||||
@ -361,7 +361,7 @@ thread_name(void)
|
|||||||
name = spdk_thread_get_name(thread);
|
name = spdk_thread_get_name(thread);
|
||||||
SPDK_CU_ASSERT_FATAL(name != NULL);
|
SPDK_CU_ASSERT_FATAL(name != NULL);
|
||||||
CU_ASSERT(strcmp(name, "test_thread") == 0);
|
CU_ASSERT(strcmp(name, "test_thread") == 0);
|
||||||
spdk_free_thread(thread);
|
spdk_thread_exit(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t device1;
|
static uint64_t device1;
|
||||||
|
Loading…
Reference in New Issue
Block a user