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

thread: Allow nested spdk_thread_poll calls



This wasn't allowed at first to make debugging these
thread changes easier. Now they're mostly solid, so
let's allow this behavior.

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


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent c43cb6a7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -328,11 +328,11 @@ int
spdk_thread_poll(struct spdk_thread *thread, uint32_t max_msgs)
{
	uint32_t msg_count;
	struct spdk_thread *orig_thread;
	struct spdk_poller *poller;
	int rc = 0;

	assert(_get_thread() == NULL);

	orig_thread = _get_thread();
	tls_thread = thread;

	msg_count = _spdk_msg_queue_run_batch(thread, max_msgs);
@@ -395,7 +395,7 @@ spdk_thread_poll(struct spdk_thread *thread, uint32_t max_msgs)
		}
	}

	tls_thread = NULL;
	tls_thread = orig_thread;

	return rc;
}