Commit b1c79d72 authored by Ben Walker's avatar Ben Walker Committed by Darek Stojaczyk
Browse files

thread: Rename spdk_allocate_thread to spdk_thread_create



This mirrors pthread_create, which works more closely
to the new style where SPDK libraries can spawn their
own threads.

Change-Id: Ic524c4c35bcf7c1611e4f261ebb64b98ac5a5a1b
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/440596


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent 1068e22d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ spdk_fio_init_thread(struct thread_data *td)
	fio_thread->td = td;
	td->io_ops_data = fio_thread;

	fio_thread->thread = spdk_allocate_thread("fio_thread");
	fio_thread->thread = spdk_thread_create("fio_thread");
	if (!fio_thread->thread) {
		free(fio_thread);
		SPDK_ERRLOG("failed to allocate thread\n");
+3 −3
Original line number Diff line number Diff line
@@ -188,15 +188,15 @@ int spdk_thread_lib_init(spdk_new_thread_fn new_thread_fn);
void spdk_thread_lib_fini(void);

/**
 * Initializes the calling thread for I/O channel allocation.
 * Creates a new SPDK thread object.
 *
 * \param name Human-readable name for the thread; can be retrieved with spdk_thread_get_name().
 * The string is copied, so the pointed-to data only needs to be valid during the
 * spdk_allocate_thread() call. May be NULL to specify no name.
 * spdk_thread_create() call. May be NULL to specify no name.
 *
 * \return a pointer to the allocated thread on success or NULL on failure..
 */
struct spdk_thread *spdk_allocate_thread(const char *name);
struct spdk_thread *spdk_thread_create(const char *name);

/**
 * Release any resources related to the given thread and destroy it. Execution
+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ _spdk_reactor_run(void *arg)
	char			thread_name[32];

	snprintf(thread_name, sizeof(thread_name), "reactor_%u", reactor->lcore);
	thread = spdk_allocate_thread(thread_name);
	thread = spdk_thread_create(thread_name);
	if (!thread) {
		return -1;
	}
+1 −1
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ void SpdkInitializeThread(void)
	struct spdk_thread *thread;

	if (g_fs != NULL) {
		thread = spdk_allocate_thread("spdk_rocksdb");
		thread = spdk_thread_create("spdk_rocksdb");
		spdk_set_thread(thread);
		g_sync_args.channel = spdk_fs_alloc_io_channel_sync(g_fs);
	}
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ spdk_thread_lib_fini(void)
}

struct spdk_thread *
spdk_allocate_thread(const char *name)
spdk_thread_create(const char *name)
{
	struct spdk_thread *thread;

Loading