Revert "Remove duplicate of a counter in hwthread_update_threads"
commit09731b69a6f50c7e0e2f6fa0ba245374034217cb
authorTomas Vanek <vanekt@fbl.cz>
Sun, 30 Oct 2022 08:22:37 +0000 (30 08:22 +0000)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 11 Nov 2022 20:22:53 +0000 (11 20:22 +0000)
treec905b148e562ef70bf2e42c61dfe5f18e81f70f8
parent3da0c2504c14ea0736b973fa0b5085c42a9c6ce8
Revert "Remove duplicate of a counter in hwthread_update_threads"

Commit 0cedf10f8fd6 ("Remove duplicate of a counter in
hwthread_update_threads") introduced a code bug.

In the second foreach_smp_target() loop, variable "threads_found"
gets passed to routine hwthread_fill_thread(). By removing the
counting of threads_found from the second loop, the
incorrect thread counter value gets passed to hwthread_fill_thread().

Change-Id: Ie89e53ccd28bb72b6838ef2f12106a1fe8d00994
Suggested-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7307
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/rtos/hwthread.c