bsd-user: Add stop_all_tasks

Similar to the same function in linux-user: this stops all the current tasks.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
staging
Warner Losh 2021-09-19 01:11:43 -06:00
parent 7aac739234
commit 653ccec26d
2 changed files with 10 additions and 0 deletions

View File

@ -195,6 +195,15 @@ static void usage(void)
__thread CPUState *thread_cpu;
void stop_all_tasks(void)
{
/*
* We trust when using NPTL (pthreads) start_exclusive() handles thread
* stopping correctly.
*/
start_exclusive();
}
bool qemu_cpu_is_self(CPUState *cpu)
{
return thread_cpu == cpu;

View File

@ -103,6 +103,7 @@ typedef struct TaskState {
} __attribute__((aligned(16))) TaskState;
void init_task_state(TaskState *ts);
void stop_all_tasks(void);
extern const char *qemu_uname_release;
/*