tools/sched_ext: scx_userland: fix restart and stats thread lifecycle bugs
Fix three issues in scx_userland's restart path:
- exit_req is not reset on restart, causing sched_main_loop() to exit
immediately without doing any scheduling work.
- stats_printer thread handle is local to spawn_stats_thread(), making
it impossible to join from main(). Promote it to file scope.
- The stats thread continues reading skel->bss after the skeleton is
destroyed on restart, causing a use-after-free. Join the stats thread
before destroying the skeleton to ensure it has exited.
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>