Commit 0901744b authored by Niu Yawei's avatar Niu Yawei Committed by Changpeng Liu
Browse files

thread: Export spdk_set_thread()



Export the spdk_set_thread(), so that apps may use it to associate
a thread with SPDK thread when necessary.

Change-Id: I488bea639729d68d7261a497085bbec274357224
Signed-off-by: default avatarNiu Yawei <yawei.niu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461509


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 9d503727
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -205,6 +205,13 @@ void spdk_thread_lib_fini(void);
 */
struct spdk_thread *spdk_thread_create(const char *name, struct spdk_cpuset *cpumask);

/**
 * Force the current system thread to act as if executing the given SPDK thread.
 *
 * \param thread The thread to set.
 */
void spdk_set_thread(struct spdk_thread *thread);

/**
 * Mark the thread as exited, failing all future spdk_thread_poll() calls. May
 * only be called within an spdk poller or message.
+0 −6
Original line number Diff line number Diff line
@@ -38,10 +38,4 @@

struct spdk_thread;

/**
 * Force the current system thread to act as if executing the given SPDK thread.
 * This is only used for unit testing.
 */
void spdk_set_thread(struct spdk_thread *thread);

#endif /* SPDK_THREAD_INTERNAL_H_ */