diff --git a/include/spdk/thread.h b/include/spdk/thread.h index 64b04bec9..3b1d7f738 100644 --- a/include/spdk/thread.h +++ b/include/spdk/thread.h @@ -226,6 +226,15 @@ void spdk_thread_exit(struct spdk_thread *thread); */ void *spdk_thread_get_ctx(struct spdk_thread *thread); +/** + * Get the thread's cpumask. + * + * \param thread The thread to get the cpumask for. + * + * \return cpuset pointer + */ +struct spdk_cpuset *spdk_thread_get_cpumask(struct spdk_thread *thread); + /** * Return the thread object associated with the context handle previously * obtained by calling spdk_thread_get_ctx(). diff --git a/lib/thread/thread.c b/lib/thread/thread.c index 391169582..c66281bd0 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -339,6 +339,12 @@ spdk_thread_get_ctx(struct spdk_thread *thread) return NULL; } +struct spdk_cpuset * +spdk_thread_get_cpumask(struct spdk_thread *thread) +{ + return thread->cpumask; +} + struct spdk_thread * spdk_thread_get_from_ctx(void *ctx) {