Commit 403c0ec1 authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Jim Harris
Browse files

thread: retry exiting a thread in interrupt mode



If thread_exit() returns early, because of pending messages, active
pollers etc., it won't be called again if the thread is in interrupt
mode. It is only called once, from a message sent in spdk_thread_exit().
Send the message again if thread_exit() doesn't change the state to
SPDK_THREAD_STATE_EXITED.

Fixes #3340

Signed-off-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I240d6b5e2a5ea866a494bf23670f1c0d75240a43
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22926


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent d1698dca
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1144,6 +1144,10 @@ _thread_exit(void *ctx)
	assert(thread->state == SPDK_THREAD_STATE_EXITING);

	thread_exit(thread, spdk_get_ticks());

	if (thread->state != SPDK_THREAD_STATE_EXITED) {
		spdk_thread_send_msg(thread, _thread_exit, thread);
	}
}

int