Commit 644e6420 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

lib/thread: Add API to check if the thread is marked as exited



Add spdk_thread_is_exited() to check if the thread is marked as
exited.  This API will be used by reactor to destroy the thread
which exited voluntarily.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2086984b7813e8a1f401852fde7ab263bcf8ef60
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/481


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 2be78638
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -232,6 +232,15 @@ void spdk_set_thread(struct spdk_thread *thread);
 */
void spdk_thread_exit(struct spdk_thread *thread);

/**
 * Returns whether the thread is marked as exited.
 *
 * \param thread The thread to query.
 *
 * \return true if marked as exited, false otherwise.
 */
bool spdk_thread_is_exited(struct spdk_thread *thread);

/**
 * Destroy a thread, releasing all of its resources. May only be called
 * on a thread previously marked as exited.
+6 −0
Original line number Diff line number Diff line
@@ -355,6 +355,12 @@ spdk_thread_exit(struct spdk_thread *thread)
	thread->exit = true;
}

bool
spdk_thread_is_exited(struct spdk_thread *thread)
{
	return thread->exit;
}

void
spdk_thread_destroy(struct spdk_thread *thread)
{