Commit 10db82bf authored by Adithya Baglody's avatar Adithya Baglody Committed by Anas Nashif
Browse files

kernel: thread: Repeated thread abort crashes.



When CONFIG_THREAD_MONITOR is enabled, repeated thread abort
calls on a dead thread will cause the _thread_monitor_exit to
crash.

Signed-off-by: default avatarAdithya Baglody <adithya.nagaraj.baglody@intel.com>
parent be0aa2ac
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -137,11 +137,14 @@ void _thread_monitor_exit(struct k_thread *thread)
		struct k_thread *prev_thread;

		prev_thread = _kernel.threads;
		while (thread != prev_thread->next_thread) {
		while (prev_thread != NULL &&
		       thread != prev_thread->next_thread) {
			prev_thread = prev_thread->next_thread;
		}
		if (prev_thread != NULL) {
			prev_thread->next_thread = thread->next_thread;
		}
	}

	irq_unlock(key);
}