Revert "kernel/sched: Fix lockless ordering in halt_thread()"

This reverts commit 02b24911f7.

This PR introduced 2 regressions in main CI:
71977 & 71978
Let's revert it by now to get main's CI passing again.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2024-04-26 09:37:42 +02:00 committed by Fabio Baltieri
parent aa67e5872a
commit c60d4c2589

View file

@ -195,7 +195,6 @@ static inline bool is_halting(struct k_thread *thread)
/* Clear the halting bits (_THREAD_ABORTING and _THREAD_SUSPENDING) */
static inline void clear_halting(struct k_thread *thread)
{
barrier_dmem_fence_full(); /* Other cpus spin on this locklessly! */
thread->base.thread_state &= ~(_THREAD_ABORTING | _THREAD_SUSPENDING);
}
@ -1297,6 +1296,7 @@ static void halt_thread(struct k_thread *thread, uint8_t new_state)
*/
if ((thread->base.thread_state & new_state) == 0U) {
thread->base.thread_state |= new_state;
clear_halting(thread);
if (z_is_thread_queued(thread)) {
dequeue_thread(thread);
}
@ -1324,7 +1324,6 @@ static void halt_thread(struct k_thread *thread, uint8_t new_state)
update_cache(1);
if (new_state == _THREAD_SUSPENDED) {
clear_halting(thread);
return;
}
@ -1366,12 +1365,6 @@ static void halt_thread(struct k_thread *thread, uint8_t new_state)
if (dummify && !IS_ENABLED(CONFIG_ARCH_POSIX)) {
z_dummy_thread_init(&_thread_dummy);
}
/* Finally update the halting thread state, on which
* other CPUs might be spinning (see
* thread_halt_spin()).
*/
clear_halting(thread);
}
}